jena icon indicating copy to clipboard operation
jena copied to clipboard

GH-1754: Force headless mode, use chromium & experimental setting to prevent X server

Open kinow opened this issue 2 years ago • 12 comments

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.

kinow avatar Feb 12 '23 22:02 kinow

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?

kinow avatar Feb 12 '23 22:02 kinow

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?

kinow avatar Feb 12 '23 22:02 kinow

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".

afs avatar Feb 13 '23 15:02 afs

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

afs avatar Feb 13 '23 15:02 afs

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

kinow avatar Feb 13 '23 16:02 kinow

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

afs avatar Feb 13 '23 16:02 afs

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…

kinow avatar Feb 13 '23 20:02 kinow

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?

kinow avatar Feb 13 '23 21:02 kinow

(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: )

kinow avatar Feb 13 '23 21:02 kinow

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.

afs avatar Feb 15 '23 10:02 afs

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.

kinow avatar Mar 26 '23 21:03 kinow

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.

kinow avatar Apr 07 '23 18:04 kinow

Just tested https://github.com/apache/jena/issues/1754 and the issue is not happening. Closing this for now :+1:

kinow avatar Mar 10 '24 14:03 kinow