-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run cypress #1479
Run cypress #1479
Conversation
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
# prefix: /app | ||
# | ||
# - name: Publish code coverage to Codecov | ||
# uses: codecov/codecov-action@v3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disabling just to run CI a bit faster. Will add it back later.
- name: Install | ||
run: yarn install | ||
- name: Start Skosmos | ||
run: cd dockerfiles && docker compose up -d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here before we run the tests, we can have a step that loads datasets, if necessary.
Startup of Skosmos is taking ~2.5 minutes on GH Actions with Docker Compose. So the overall execution for Cypress is quite good for now.
@@ -2,7 +2,7 @@ const { defineConfig } = require("cypress"); | |||
|
|||
module.exports = defineConfig({ | |||
e2e: { | |||
baseUrl: 'http://localhost/Skosmos', | |||
baseUrl: 'http://localhost:9090/', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can pass that via command line too. If most devs will use their own localhost/Skosmos instead of docker or 9090, that might make more sense. Changed here as that was the simplest to get the Cypress tests executed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ignore these dockerfiles modified here. I just cherry-picked from #1477
Thanks a lot @kinow , I will review this soon! |
This looks very promising! A few comments: Vocabulary data filesOne of the tests failed because YSO isn't available. This is not a surprise and not the fault of this PR. We have discussed how to set up the Skosmos and Fuseki environment for the Cypress tests. The challenge is that this should be standardized as much as possible, so that tests are running in a similar environment both under CI and locally on developer machines. This is basically the current plan:
This way we can write Cypress tests knowing that Skosmos is configured in a standard way and Fuseki contains a specific, known set of vocabulary data. For this PR, 1. is already done, 2. requires using Installing node.js packagesI noticed you've used Cleaning up before mergingThis is probably obvious, but clarifying just in case:
|
I decided to reimplement the Action that runs Cypress under CI rather than continuing from this PR, because it was easier to start from the current state of the skosmos-3 branch which has changed a lot since this PR was opened. |
Reasons for creating this PR
Run Cypress in GitHub Actions.
Link to relevant issue(s), if any
Description of the changes in this PR
Hi, this builds on top of #1477 and #1474. The first switches to Apache Jena Fuseki image (which is a lot simpler to run as it doesn't have a bug with volumes and restarting the process). The second PR is adding some Cypress tests, so I used that one as base here for running some tests.
Known problems or uncertainties in this PR
Out of the 7 tests in #1474, one is failing due to the YSO not being included with the Docker Compose recipe. On my working copy, I started writing some code to download
yso.ttl
in GH Actions, and then load the dataset into the running Docker container. But I decided to wait to see if that Cypress test will be kept or not.Instead of running the actual dataset, with Cypress we can also mock the calls and pretend Skosmos replied something, which saves us from having to load the dataset. But since we have a running instance with Docker compose, we can do it whichever way works best for others -- https://docs.cypress.io/api/commands/intercept#Usage
Checklist
.sr-only
class, color contrast)