Page MenuHomeSoftware Heritage

Modify some configuration to allow running cypress tests in parallel
ClosedPublic

Authored by anlambert on Aug 26 2022, 5:20 PM.

Details

Summary

That diff compiles a set of commits needed to enable successfull runs of
cypress tests in parallel (for faster CI builds on Jenkins).

After battle testing the parallel cypress tests on our Jenkins instance,
some flaky tests appeared when running multiple Jenkins jobs in parallel
so I also fixed those.

Related to D8328

Related to T3423

commit 4b83f99981a4e29e0254589e5dd5d730fdf7f42e (HEAD -> cypress-parallel-tests, origin/cypress-parallel-tests)
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Fri Aug 26 16:31:10 2022 +0200

    cypress/add-forge-now-request-create: Add missing wait instructions

commit 4a8de541123b0e83371be11716d85bdf8cb6a321
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Fri Aug 26 13:48:14 2022 +0200

    cypress.config.js: Add projectId
    
    This is required to run cypress tests in parallel.
    
    CYPRESS_PROJECT_ID environment variable could be used but better
    add project id in config.

commit b7be6a88dce78661ecb214096df86138fd390abc
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Thu Aug 25 21:15:33 2022 +0200

    cypress/origin-save: Add wait instructions to fix flaky tests
    
    Some tests were flaky in this test suite due to missing wait instructions
    ensuring save code now requests datatable got fully rendered.

commit 3adcbde7f785ee090238657e8da99eb5493e6993
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Thu Aug 25 11:53:15 2022 +0200

    cypress/admin: Add missing intercept in test implementation

commit 61b575db215d417fdf1924e6eddb92c71b37a71d
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Thu Aug 25 10:54:35 2022 +0200

    sqlite: Use multiple database files when running parallel cypress tests
    
    When running cypress tests in parallel, each runner must have its dedicated
    webapp database. Using the same database cause issues as multiple cypress
    processes modify its content concurrently and make some tests fail due
    to unexpected database state.

commit cb03344f8a58506f77b40dde58f348a709944303
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Thu Aug 25 10:48:29 2022 +0200

    package.json: Add cy2 development dependency
    
    It is needed to run cypress tests in parallel using sorry-cypress.

Diff Detail

Repository
rDWAPPS Web applications
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build is green

Patch application report for D8326 (id=30075)

Rebasing onto a7ab8afb19...

Current branch diff-target is up to date.
Changes applied before test
commit 4b83f99981a4e29e0254589e5dd5d730fdf7f42e
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Fri Aug 26 16:31:10 2022 +0200

    cypress/add-forge-now-request-create: Add missing wait instructions

commit 4a8de541123b0e83371be11716d85bdf8cb6a321
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Fri Aug 26 13:48:14 2022 +0200

    cypress.config.js: Add projectId
    
    This is required to run cypress tests in parallel.
    
    CYPRESS_PROJECT_ID environment variable could be used but better
    add project id in config.

commit b7be6a88dce78661ecb214096df86138fd390abc
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Thu Aug 25 21:15:33 2022 +0200

    cypress/origin-save: Add wait instructions to fix flaky tests
    
    Some tests were flaky in this test suite due to missing wait instructions
    ensuring save code now requests datatable got fully rendered.

commit 3adcbde7f785ee090238657e8da99eb5493e6993
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Thu Aug 25 11:53:15 2022 +0200

    cypress/admin: Add missing intercept in test implementation

commit 61b575db215d417fdf1924e6eddb92c71b37a71d
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Thu Aug 25 10:54:35 2022 +0200

    sqlite: Use multiple database files when running parallel cypress tests
    
    When running cypress tests in parallel, each runner must have its dedicated
    webapp database. Using the same database cause issues as multiple cypress
    processes modify its content concurrently and make some tests fail due
    to unexpected database state.

commit cb03344f8a58506f77b40dde58f348a709944303
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Thu Aug 25 10:48:29 2022 +0200

    package.json: Add cy2 development dependency
    
    It is needed to run cypress tests in parallel using sorry-cypress.

See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/2015/ for more details.

This revision is now accepted and ready to land.Aug 26 2022, 5:45 PM