GH-1754: Force headless mode, use chromium & experimental setting to prevent X server
GitHub issue resolved #1754
Pull request Description:
Also includes a commit to fix yarn run test:e2e. I used the env vars for coverage (that calls e2e tests), but forgot to include it for e2e tests when called by itself.
- [ ] Tests are included.
- [ ] Documentation change and updates are provided for the Apache Jena website
- [ ] Commits have been squashed to remove intermediate development commit messages.
- [x] Key commit messages start with the issue number (GH-xxxx or JENA-xxxx)
By submitting this pull request, I acknowledge that I am making a contribution to the Apache Software Foundation under the terms and conditions of the Contributor's Agreement.
See the Apache Jena "Contributing" guide.
I think this should fix the issue, but I couldn't reproduce it locally. Will see if I can trigger Jenkins to run from this PR or from my branch?
Hmmm, had a look at ASF's Jenkins, I can see the error, but the job is not parametrized. How do you test PR's or branches with Jenkins, @afs?
How do you test PR's or branches with Jenkins
I don't :smile:
I pull the PR and run locally - in this case using "ssh -x localhost".
I pulled the branch, did a ssh -x.
The yarn.lock file is out of date.
Even fixing that, completely clearing out node_modules and running yarn install:
[INFO] [TESTS] [FAILED] /home/afs/.cache/Cypress/12.5.1/Cypress/Cypress: bad option: --no-sandbox
[INFO] [TESTS] [FAILED] /home/afs/.cache/Cypress/12.5.1/Cypress/Cypress: bad option: --smoke-test
[INFO] [TESTS] [FAILED] /home/afs/.cache/Cypress/12.5.1/Cypress/Cypress: bad option: --ping=842
The yarn.lock file is out of date.
Weird, I'm on this branch and I get no changes
$ yarn install
yarn install v1.22.5
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.52s.
$ git status
On branch headless1
Your branch is up to date with 'kinow/headless1'.
nothing to commit, working tree clean
Even fixing that, completely clearing out node_modules and running yarn install:
Really strange. I deleted my node_modules folder, then did a yarn install... no changes in git status. If you'd like to compare versions:
$ yarn -v
1.22.5
$ node -v
v16.19.0
Pulling the PR branch:
package.json is 956cb17611 (19 hours ago)
yarn.lock is 10f9205902 (2 weeks ago)
I have yarn 1.22.19 I have node 18.13.0
Upgraded node, and then ran yarn install.
node -v
v18.14.0
No difference in package.json.
Then upgraded yarn too (I wasn't aware of corepack in yarn!)
$ yarn -v
1.22.19
Removed the yarn.lock and then it finally upgraded to the latest versions :grimacing:
Tried forcing headless mode, but made no difference. Interesting…
Ah, ok. So we are not crazy. The Cypress bug about headless requiring xvfb is this one https://github.com/cypress-io/cypress/issues/6012.
It was closed but pointing to a new bug, as it looks like Electron is the one that's requiring the X server: https://github.com/cypress-io/cypress/issues/3899
This last issue is still open, so not much to do for now, unless we start an X server in the Jenkins job, @afs?
(or downgrade Cypress... I've upgraded all the dependencies before finding these issues in Cypress, so I will push it to this branch too anyway :shrug: )
This last issue is still open, so not much to do for now, unless we start an X server in the Jenkins job, @afs?
We can put back the "don't fail build if e2e fails" setting.
It is working properly when there is graphics. So while it is a visual check, we aren't blocked. CI on the rest of the system works and personally I don't look at the automation logs until the run goes red.
The cypress bug is now fixed, https://github.com/apache/jena/pull/1755#issuecomment-1428675379, but I haven't tested it yet.
#1679 has further fixes & improvements to the Cypress configuration. Once that one is merged, I will rebase this one merging the configuration changes.
This is more of a nice-to-have for developers. So we don't have to hurry on this for the upcoming release.
Ah, looked at the wrong issue linked in this PR. The Cypress bug is still open, so nothing to do here: https://github.com/cypress-io/cypress/issues/3899. Rebased this PR anyway.
Just tested https://github.com/apache/jena/issues/1754 and the issue is not happening. Closing this for now :+1: