Closed da-h closed 2 years ago
WOW I love the cypress testing suite here. Huge kudos for getting it set up! I'd love to get this into CI for the project in some form, which I know @mariobehling was hoping we could add at some point.
I think I'm running into some issues though, and I'm not sure quite why:
Some tests fail with missing content
And others aren't getting the exact value they're looking for
but most frequently tests fail because "Timed out retrying after 4000ms: Expected to find element: .rc-tree-select-selection__clear, but never found it.
", but I think that has to do with a cascading failure after the env window isn't closed.
Too bad I got sloppy at the end. Sorry for the rough mistakes. -.-
Please check my resubmission above. :)
There were a few places that needed to be revisited:
run
task with option asyncrun: true
): a space was missing between the arguments in some cases.npm run test:init
and npm run test
. I have added a hook (after:screenshot
) that saves the screenshots somewhere safe when running init-scripts, i.e. cypress/screenshots_init
instead of cypress/screenshots
.npm run test:init
script did not use the exact same visual spot for taking the screenshot. This should be fixed now.npm run test
to ignore any *.init.js
files. I also added a dedicated npm run test:visual
to only run a visual regression test.numDifferentPixels
. I have switched to the synced filesystem commands there.>
symbol, which I removed.asyncrun: true
).servery.py
did not use consistent orders.server.py
before iterating (see 2nd last commit) & also ensuring that the tests show up in correct order (by prepending numbers before starting the envs). In total, these are the issues I found during testing or / and which I will file in next week in the issue tracker:
Here are a few more notes:
server.py
to fix the occurring error in the image_history
test.Unfortunately there were still two small bugs in it. I have to admit, this whole PR was much more fiddly than I expected. :)
TreeSelect
, because this actually gets the argument treeDefaultExpandAll
. I did not see this problem before, as I didn't restart the server too often during cypress testing.
I solved the problem by having the test script open all closed folders in the selection.x_download
tests got inconsistent results. I guess this is due to varying download speeds / buffering speeds.I will repush the CI and the changed files later today.
I have to admit, this whole PR was much more fiddly than I expected
No worries @da-h - you took on a pretty impressive set of changes rather quickly. I'm always happy to review and help - there's no rush!
Here are the most recent changes:
npm test
requirement from PULL_REQUEST_TEMPLATE.mdThe new workflow "process-changes" does the following:
*.js
files changedprepare
to download / or load cached data to speed-up the actions overall. (caching of pip
and npm
downloads)In total, the process looks like this:
I have tested the new CI using these three PRs
It seems there is one last error in fetching from a feature branch if $GITHUB_HEAD_REF
is coming from a fork (instead of origin).
As far as I can tell, this PR is now ready for the detailed review. Sorry again for the constant back and forth. As I said, this PR was quite a bumpy ride after all.
The last two commits change the process a bit, introducing the committing of build files in a seperate job.
With one exception, the errors in the PR-checks below are only due to missing files on master that are introduced in this very PR. As shown in the example PRs these errors do not show up in succeeding PRs.
The remaining error in the functional test is a bit mysterious as I cannot reproduce it, neither on my machine, nor on the PR-tests linked above.
As a final test, I tried to test against the changes in #849. (See the respective test-PR in my own fork)
Unfortunately, two CI-runs of the same pr yield inconsistent results, while it passes locally on my maschine.
See:
After having read a bit about other people complaining about inconsistent cypress results, especially in github action runs (e.g. here), i think I have finally found the solution for the problem. It was a user error -- what else.
First, & just for future reference. I have tested many suggestions (from the links above) without success:
.click()
events (seemed to be a common problem for angular-apps).trigger('click')
instead of .click()
which triggers on the original dom state, in contrast to click()
which may fail on dom changes during click event itselfwait
after actions that may take longer to processThe error was:
.click().click()
instead of .dblclick()
in one testcy.get('input[value="on"]')
was inconsistent, while cy.get('input[type="checkbox"]')
is not (which i do not understand)I set the PR thus again on ready, and turn again at the CI-failure-success wheel of fortune. ;) The argument for a (this time) truly finished PR are the following consistent results of the functional tests here, here and here.
PS: As explained above, the visual regression tests are expected to fail for now due to missing files in the current master branch.
In the newest revision, I reverted to the original workflow update-js-build-files.yml
.
I had hoped to merge the two workflows, but it is not so easy or at least not intended to commit to the original branch automatically when a PR is based on a branch of a fork. So the current suggestion is to leave the static-build-files-bot as it was (i.e. push-events initiate the bot on a per-branch basis) and additionally run the cypress tests on an incoming PR.
The advantage of all these additional tests is at least that the cypress CI tests have now been run several more times and i am now more sure that they are consistent. :)
🥳
Description
This PR implements a baseline for automated testing of visdom using cypress.
Motivation and Context
Following the discussion in #849, this PR introduces some basic tests for many features of visdom.
In more detail:
demo.py
have been split into seperate files and functions to enable triggering them seperately. There is a test for each example.Additionally:
data-cy
-attribute to the filter input field to better match it in the testjs/PropertiesPane.js
CONTRIBUTING.md
andPULL_REQUEST_TEMPLATE.md
to show the use of the new commandsHow Has This Been Tested?
Who tests the tester? ;)
If you want to try it, do:
8098
npm run test:gui
screenshots.init.js
(otherwise the visual regression tests inscreenshots.js
will fail)Screenshots (if appropriate):
Types of changes
Checklist:
npm test
. (Please check the CONTRIBUTING.MD file for details.)