Page MenuHomeSoftware Heritage

cypress: Migrate to 6.0
ClosedPublic

Authored by anlambert on Dec 2 2020, 3:36 PM.

Details

Summary

Migrate to latest major version of cypress according to their migration guide.

I also tried to move from the cy.route() command to the new cy.intercept() command
for mocking HTTP requests but it currently does not allow to override a previously mocked request (https://github.com/cypress-io/cypress/issues/9302)
which makes some swh-web tests not portable at the moment. So this will be done later.

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 D4650 (id=16497)

Rebasing onto 8822b6aa63...

Current branch diff-target is up to date.
Changes applied before test
commit 35d0737255164089a56ff1c5f56558f3aa235f21
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Wed Dec 2 15:29:05 2020 +0100

    cypress: Migrate to 6.0

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

which makes some swh-web tests not portable at the moment. So this will be done later.

So what happens to them? They will fail?

which makes some swh-web tests not portable at the moment. So this will be done later.

So what happens to them? They will fail?

Unfortunately yes. See for instance that piece of code testing the vault UI. Here we mock the vault API responses to simulate an archive being cooked and test that the UI is correctly updated. As a mocked request cannot currently be overridden with cy.intercept(), the first mocked response will always be returned which makes the test fails.

There is currently an opened PR to get the same behavior as with cy.route() and I have strong reason to believe that it will be merged as multiple users are impacted by that issue.

Then why is Jenkins green on this diff?

Then why is Jenkins green on this diff?

Because I kept using cy.route() commands for the moment. I will migrate to cy.intercept() once the override issue fixed and the feature stable enough.

This revision is now accepted and ready to land.Dec 3 2020, 2:23 PM
This revision was automatically updated to reflect the committed changes.