Page MenuHomeSoftware Heritage

cypress: Skip tests marked as slow by default
ClosedPublic

Authored by anlambert on Aug 26 2019, 4:26 PM.

Details

Reviewers
vlorentz
Summary

Some cypress tests can take a long time to execute while not significantly
improving overall code coverage (e.g. language highlighting tests).

So add a way to declare a tests suite to be slow to execute and skip it
by default (notably to speedup CI jobs). In order to execute it back,
the CYPRESS_SKIP_SLOW_TESTS environment variable must be set to a value
different from 1.

Two new make targets have been added in order to execute all tests even
the slow ones:

  • test-frontend-all
  • test-frontend-all-ui

Diff Detail

Repository
rDWAPPS Web applications
Branch
speedup-cypress-tests
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 7462
Build 10645: Cypress tests for swh-web diffsJenkins
Build 10644: tox-on-jenkinsJenkins
Build 10643: arc lint + arc unit

Event Timeline

Update: rename some new make targets for more consistency with the previously defined ones

Doing exports in some target that get used by another target sounds like a bad idea for readability.

If the intent is to avoid repeating the same command, write the command in a shell script and run the shell script in each makefile target

This revision now requires changes to proceed.Aug 27 2019, 10:13 AM

And, are you sure that CYPRESS_SKIP_SLOW_TESTS=1 results in Cypress.env('SKIP_SLOW_TESTS') === 1? I would assume it's parsed as "1", not 1.

Doing exports in some target that get used by another target sounds like a bad idea for readability.

Seems pretty readable to me.

If the intent is to avoid repeating the same command, write the command in a shell script and run the shell script in each makefile target

Honestly, I do not want to add a shell script to wrap a single command and prefer to keep that in the Makefile

And, are you sure that CYPRESS_SKIP_SLOW_TESTS=1 results in Cypress.env('SKIP_SLOW_TESTS') === 1? I would assume it's parsed as "1", not 1

Yes, I tested it multiple times yesterday. It works as expected.

Seems pretty readable to me.

Even before this change I get lost whenever I want to run swh-web

Honestly, I do not want to add a shell script to wrap a single command and prefer to keep that in the Makefile

There are five commands in test-frontend-cmd, and test-frontend-ui-cmd embeds a bash script that runs seven commands

T1972 created to implement CLI for easily running and testing swh-web

This revision is now accepted and ready to land.Aug 27 2019, 11:20 AM

I forgot to rebase, landed in c66798e1dcd.