Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

feat: make tests run in parallel #352

Merged
merged 9 commits into from
Jun 28, 2022
Merged

Conversation

LuizAsFight
Copy link
Contributor

@LuizAsFight LuizAsFight commented Jun 27, 2022

As the tests are the steps taking more time, now they run in parallel.

This PR also creates some internal ✅composite actions to use in our CI workflow yml files, making them cleaner and shorter.

New actions created: setup-node, setup-rust, setup-docker

To use them in a yml:

  end-to-end-test:
    name: Test E2E
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: ./.github/setup-node
      - uses: ./.github/setup-rust
      - uses: ./.github/setup-docker
        with:
          password: ${{ secrets.GITHUB_TOKEN }}

This helps avoiding a lot of duplicated code. To fix it I also tried to use:
❌ Reusable workflows - https://docs.github.com/en/actions/using-workflows/reusing-workflows - we're not able to use the same context after executing a reusable workflow, so we cannot use it to build envs. Which is our use case.
❌ Centralize env setup in a docker image - we run a docker environment (pnpm ci:test) to run the app, which would lead us to a Docker in Docker situation. Which is known to have several issues (https://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/). Better to make it simples and avoid issues.

Closes #309

@LuizAsFight LuizAsFight self-assigned this Jun 27, 2022
@LuizAsFight LuizAsFight marked this pull request as ready for review June 28, 2022 02:06
@LuizAsFight LuizAsFight requested a review from pedronauck June 28, 2022 02:12
NODE_ENV: "test"
# debugging seems to make tests slower randomly. you can include if you need to track issues in CI
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove it if will not be required

@LuizAsFight LuizAsFight merged commit 69e3f77 into master Jun 28, 2022
@LuizAsFight LuizAsFight deleted the lf-309/feat/parallel-tests branch June 28, 2022 15:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Run tests (jest, cypress) in parallel in CI actions
2 participants