Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix CI - chunk up Jest tests #2096

Merged
merged 1 commit into from
Jul 12, 2022

Conversation

petermetz
Copy link
Contributor

@petermetz petermetz commented Jun 22, 2022

  1. ci.yml workflows went through a massive refactoring to parallelize
    the test execution for two main reasons: First this makes it faster,
    second this also reduces the flakyness that comes from our ever growing
    test suite making the test runner consume more and more RAM (the back
    story here is that Yarn needed more than 2 GB RAM at first, and
    when we bumped the heap size up to 3 GB it exhausted that soon after at
    which point it became clear that this is not sustainable at all on the
    long run since our GitHub CI runners come with 7 GB RAM total)

  2. tools/ci.sh can now be configured via environment variables:

  • DEV_BUILD_DISABLED (defaults to false)
    true/false: if set to true the initial configure script execution is skipped

  • FULL_BUILD_DISABLED (defaults to false)
    true/false: if set to true the final full build (webpack & prod builds) is skipped

  • JEST_TEST_RUNNER_DISABLED (defaults to false)

true/false: if set to true, Jest tests are skipped completely.

  • JEST_TEST_PATTERN (default comes from jest.config.js)

string pattern: if specified, it will narrow the scope of tests as specified

  • TAPE_TEST_RUNNER_DISABLED (defaults to false)

true/false: if set to true, Tape tests are skipped completely.

  • TAPE_TEST_PATTERN (default comes from .taprc config file)

string pattern: if specified, it will narrow the scope of tests as specified

  1. sorted all the yaml keys in the ci.yml file for easier location of the jobs in the future
    since there is now 30+ jobs in the file which are taking up a total of 1k LoC at the moment.

  2. TODO for the future is to start using job templates so that the LoC can be reduced significantly
    See point 3. about the details on this.

Fixes #2090

Signed-off-by: Peter Somogyvari peter.somogyvari@accenture.com

1. ci.yml workflows went through a massive refactoring to parallelize
the test execution for two main reasons: First this makes it faster,
second this also reduces the flakyness that comes from our ever growing
test suite making the test runner consume more and more RAM (the back
story here is that Yarn needed more than 2 GB RAM at first, and
when we bumped the heap size up to 3 GB it exhausted that soon after at
which point it became clear that this is not sustainable at all on the
long run since our GitHub CI runners come with 7 GB RAM total)

2. tools/ci.sh can now be configured via environment variables:

  - DEV_BUILD_DISABLED (defaults to false)
  true/false: if set to true the initial configure script execution is skipped

  - FULL_BUILD_DISABLED (defaults to false)
  true/false: if set to true the final full build (webpack & prod builds) is skipped

  - JEST_TEST_RUNNER_DISABLED (defaults to false)

  true/false: if set to true, Jest tests are skipped completely.

  - JEST_TEST_PATTERN (default comes from jest.config.js)

  string pattern: if specified, it will narrow the scope of tests as specified

  - TAPE_TEST_RUNNER_DISABLED (defaults to false)

  true/false: if set to true, Tape tests are skipped completely.

  - TAPE_TEST_PATTERN (default comes from .taprc config file)

  string pattern: if specified, it will narrow the scope of tests as specified

3. sorted all the yaml keys in the ci.yml file for easier location of the jobs in the future
since there is now 30+ jobs in the file which are taking up a total of 1k LoC at the moment.

4. TODO for the future is to start using job templates so that the LoC can be reduced significantly
See point 3. about the details on this.

Fixes hyperledger-cacti#2090

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
@petermetz petermetz merged commit aafeea4 into hyperledger-cacti:main Jul 12, 2022
@petermetz petermetz deleted the petermetz/issue2090 branch July 12, 2022 00:41
johnhomantaring added a commit to johnhomantaring/cactus that referenced this pull request Jul 20, 2022
Fixes hyperledger-cacti#1890
Depends on hyperledger-cacti#2096

Signed-off-by: john.h.o.mantaring-at-475704139995 <john.h.o.mantaring@accenture.com>
johnhomantaring added a commit to johnhomantaring/cactus that referenced this pull request Jul 20, 2022
Fixes hyperledger-cacti#1890
Depends on hyperledger-cacti#2096

Signed-off-by: john.h.o.mantaring-at-475704139995 <john.h.o.mantaring@accenture.com>
petermetz pushed a commit to johnhomantaring/cactus that referenced this pull request Jul 20, 2022
Fixes hyperledger-cacti#1890
Depends on hyperledger-cacti#2096

Signed-off-by: john.h.o.mantaring-at-475704139995 <john.h.o.mantaring@accenture.com>
petermetz pushed a commit that referenced this pull request Jul 21, 2022
Fixes #1890
Depends on #2096

Signed-off-by: john.h.o.mantaring-at-475704139995 <john.h.o.mantaring@accenture.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test: fix CI - chunk up Jest tests
3 participants