-
Notifications
You must be signed in to change notification settings - Fork 641
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
GH-2344: Yarn fails on windows CI-BUILD #2410
base: main
Are you sure you want to change the base?
Conversation
bf85dc2
to
55073f7
Compare
Tested and ran on linux job which looks good, but confused me a bit first because the ordering of running the tests changed between runs. I guess the removal of the default operator may mean that the e2e becomes more clunky to run locally or standalone? FUSEKI_PORTS and PORTS changed between each run. There are a few more errors after the tests for windows:
|
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.
This looks like an improvement.
I ran before and after Windows jobs (GH actions).
I see http://localhost:%FUSEKI_PORT%/$/ping
in the breaking "before" which might be due to messing up the substitution and/or quoting and a lot of stacktraces.
With this PR, the Windows build does not print that nor have stacktraces.
There are a few more errors after the tests for windows:
(also untrained eyes 🙈 ) Are they errors or is that the test runner clearing up?
With this PR, I see: "All specs passed" which didn't happen before.
[INFO] [TESTS] ✔ All specs passed! 00:19 13 13 - - -
[INFO] [TESTS]
[INFO] [TESTS] yarn wait-on http-get://localhost:%PORT%/index.html && cypress run $@ exited with code 0
[INFO] --> Sending SIGTERM to other processes..
[INFO] [SERVER] yarn run serve:fuseki exited with code 1
[INFO] --> Sending SIGTERM to other processes..
[INFO] [CLIENT] yarn wait-on http://localhost:%FUSEKI_PORT%/$/ping && yarn run dev exited with code 1
[INFO] Done in 37.36s.
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.
I think this broke the e2e tests on Linux.
kinow@ranma:~/Development/java/jena/jena/jena-fuseki2/jena-fuseki-ui$ yarn test:e2e
yarn run v1.22.19
$ cross-env FUSEKI_PORT="${FUSEKI_PORT}" PORT="${PORT}" concurrently --names 'SERVER,CLIENT,TESTS' --prefix-colors 'yellow,blue,green' --success 'first' --kill-others "yarn run serve:fuseki" "yarn wait-on http://localhost:${FUSEKI_PORT}/$/ping && yarn run dev" "yarn wait-on http-get://localhost:${PORT}/index.html && cypress run $@"
$ nodemon src/services/mock/json-server.js
$ /home/kinow/Development/java/jena/jena/jena-fuseki2/jena-fuseki-ui/node_modules/.bin/wait-on 'http://localhost:/$/ping'
$ /home/kinow/Development/java/jena/jena/jena-fuseki2/jena-fuseki-ui/node_modules/.bin/wait-on http-get://localhost:/index.html
[SERVER] [nodemon] 3.1.0
[SERVER] [nodemon] to restart at any time, enter `rs`
[SERVER] [nodemon] watching path(s): *.*
[SERVER] [nodemon] watching extensions: js,mjs,cjs,json
[SERVER] [nodemon] starting `node src/services/mock/json-server.js`
[SERVER] JSON Server is running
^C
Cancelled after +5 minutes waiting.
Did a git checkout main
, then re-ran the tests, finished under a minute.
[TESTS] (Run Finished)
[TESTS]
[TESTS]
[TESTS] Spec Tests Passing Failing Pending Skipped
[TESTS] ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
[TESTS] │ ✔ datasets.cy.js 00:17 9 9 - - - │
[TESTS] ├────────────────────────────────────────────────────────────────────────────────────────────────┤
[TESTS] │ ✔ query.cy.js 00:03 2 2 - - - │
[TESTS] ├────────────────────────────────────────────────────────────────────────────────────────────────┤
[TESTS] │ ✔ upload.cy.js 00:03 2 2 - - - │
[TESTS] └────────────────────────────────────────────────────────────────────────────────────────────────┘
[TESTS] ✔ All specs passed! 00:24 13 13 - - -
[TESTS]
[TESTS] yarn wait-on http-get://localhost:${PORT}/index.html && cypress run $@ exited with code 0
--> Sending SIGTERM to other processes..
[SERVER] yarn run serve:fuseki exited with code SIGTERM
--> Sending SIGTERM to other processes..
[CLIENT] yarn wait-on http://localhost:${FUSEKI_PORT}/$/ping && yarn run dev exited with code SIGTERM
Done in 39.73s.
I think that's because of the missing default ports?
Running tests directly with yarn fail on linux
Adding a dependency for dotenv and using both dotenv and crossenv seems to work for the CI-Job, and the variables should be used by default from dotenv when working with it directly. I don't understand why I have to use cross-env, if I already have the env set, but it feels like the values aren't available if not listed first in the script section, prior to the job. I am clearly missing something here in how this works. Good news is that the windows job is passing and running tests even when turning on errors again in maven. Bad news is the script is kind of ugly and hackish, and adds an extra dependency (BSD). Will clean up the extra files and unused parts and push to a single commit again hopefully this evening. Node added a parameter for reading environment vars without using a library in version 20.6, but I don't think it is reachable when using yarn, from web searches. Another alternative that looks better imo, is writing a simple helper script that sets environment vars (with defaults) and adding it at the beginning. See That could mean removing a dependency (cross-env) instead of adding a dependency, however I didn't get it to work. |
03be167
to
86b5b61
Compare
… in jena-fuseki-ui * Enable failure on tests for jena-fuseki-ui maven pom. * Have separate versions for *nix and windows of test:e2e using run-script-os package * update lockfile
86b5b61
to
d8a520f
Compare
Added some comments #2344 (comment) |
GitHub issue resolved #2344
Pull request Description:
Looked at the links provided by @kinow in #2344 (comment) and tried to change
'
with\"
.This gave a new error which looks like
crossenv
doesn't support:=
on windows, in${FUSEKI_PORT:=3030}
(and PORT).Looked at crossenv on github and I think it is not available.
I looked at maybe changing the shell to run from in windows, by adding a .npmrc file, but then I got license (RAT) errors when running the CI, and instead of adding it to exclude list, I asked GPT figured the operator is probably not available in powershell. I ended up using the ENV vars only since
FUSEKI_PORT
is already used without fallback values in other locations of the package.json file.Glanced at the final e2e output in https://github.com/OyvindLGjesdal/jena/actions/runs/8623049304 and it looks good to my untrained eyes.
Have left to check if it breaks anything for Linux and Mac, and will create a single commit.
Output when only fixing the apos -> escaped quote:
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.