Hello,
I’m using circleci tests run with more than 1 parallelism & split, however the split never happens as all tests run on each container. This is with TestCafe.
What’s missing here?
circleci tests glob "tests/**/*.js" | circleci tests run --command="xargs
npx npm run release-sanity" --split-by=filesize --verbose
is that all tests are grabbed, the split applies on them to determine which tests should get triggered on each container, and then it triggers “release-sanity” script.
The script will filter testcafe tests based on the defined environment & meta scope and run them accordingly.
Yes, that is how it should be working and what you have shown matches all the examples in the docs, but I can not currently comment on what is happening within the release-sanity script.
Also as you have included --verbose on the command line can you please post the resulting output. This will show up in the step output as a number of line in the format of
Here’s the workflow output.
I have parallelism of 2. Total of 4 sanity tests.
There are 2 test files, courses_page_tests_1.js has 3 sanity tests & login_page_tests.js has one.
correctly creating the 2 independent environments to run the tests in.
splitting the 4 tests across the 2 environments. You can see this in the log as
the 4 tests are spread across the 2 DEBU Received lines.
I asked about the sanity_run script because this is what is run in each container with the test script names being passed to it as parameters. So what is the script doing with the detail? From how you describe the issue and the few lines of output on these screenshots, I wonder if the script is processing the list passed to it.
Check if the env & scope are passed in the script, in our case they are.
then it
Filter the list of tests (passed through Circle) & only run the ones with “sanity” scope meta. The scope meta is defined on the test itself.
This happens by defining the filter in testcafe config file.
What I don’t really understand is that if each container receives the correct file, then the script should filter those passed tests in that file only & run the ones with sanity scope, instead of executing all sanity scope tests in all files.
I.E container 0 receives the courses_page_tests file. Then it should run the 3 sanity tests inside this file & keep the other sanity test on login_page file to run on container 1.
Thanks for providing your example!
With echo, it lists the files. Container 0 received courses_page file which is expected.
Still not sure why each container does not run the tests on the received file only.
OK, from that output it is clear that the CircleCI environment is managing to correctly split out the test files found in the directory, but in many ways that is the easy bit.
You will need to take a look at how the tests and release-sanity script are written as they are the only place where a rescanning of the test directory can take place to cause all the tests to run within a single container.