Skip to content
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

yarn run test:e2e fails on MS Windows. #2344

Open
afs opened this issue Mar 16, 2024 · 5 comments · May be fixed by #2410
Open

yarn run test:e2e fails on MS Windows. #2344

afs opened this issue Mar 16, 2024 · 5 comments · May be fixed by #2410
Labels
build Fuseki UI help wanted Pull requests welcome.

Comments

@afs
Copy link
Member

afs commented Mar 16, 2024

The test:e2e step of the frontend-maven-plugin in jena-fuseki-ui is not managing to run the tests.

This log is from the projects github action for MS Windows.

[INFO] --- frontend-maven-plugin:1.15.0:yarn (yarn run test:e2e) @ jena-fuseki-ui ---
[INFO] Running 'yarn run test:e2e' in C:\jena\jena-fuseki2\jena-fuseki-ui
[INFO] yarn run v1.22.17
[INFO] $ cross-env FUSEKI_PORT="${FUSEKI_PORT:=3030}" PORT="${PORT:=8080}" 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 $@'
[INFO] [CLIENT] 'run' is not recognized as an internal or external command,
[INFO] [CLIENT] operable program or batch file.
[INFO] [TESTS] The filename, directory name, or volume label syntax is incorrect.
[INFO] [TESTS] serve:fuseki exited with code 1
[INFO] --> Sending SIGTERM to other processes..
[INFO] [CLIENT] run exited with code 1
[INFO] --> Sending SIGTERM to other processes..
[INFO] [5] 'http:' is not recognized as an internal or external command,
[INFO] [5] operable program or batch file.
[INFO] [5] http://localhost:%FUSEKI_PORT%/$/ping exited with code 1
[INFO] --> Sending SIGTERM to other processes..
[INFO] [SERVER] yarn exited with code 1
[INFO] --> Sending SIGTERM to other processes..
[INFO] [3] yarn exited with code 1
[INFO] --> Sending SIGTERM to other processes..
[INFO] [4] wait-on exited with code 1
[INFO] error Command failed with exit code 1.
[INFO] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error:  There are test failures.
Failed to run task: 'yarn run test:e2e' failed.
@afs afs added Fuseki UI build help wanted Pull requests welcome. labels Mar 16, 2024
@kinow
Copy link
Member

kinow commented Mar 16, 2024

Oh, I wonder if the version used on Windows is not happy about yarn run $target. It's the old style, and nowadays I believe it's moving towards yarn $target. I have Windows installed on another partition at home and $work... cannot remember the password of either, but I should be able to log in and run some tests over next days if no one beats me to it.

@kinow
Copy link
Member

kinow commented Mar 19, 2024

Booted into Windows after a long time, then

  • installed nodejs.org 22.01.1 LTS
  • updated npm as per their cmd line output message
  • installed Yarn globally with npm
  • cloned latest Jena and cd'ed into jena-fuseki-ui
  • yarn install, which worked fine with some warnings
  • yarn run test:e2e

The last command resulted in the same error message reported.

image

I removed the run part of the commands, but yarn test:e2e failed again complaining http: is not a command 🤔

@afs
Copy link
Member Author

afs commented Mar 19, 2024

complaining http: is not a command

The good news is that it is not trying to run the internet. That might take some time.

@kinow
Copy link
Member

kinow commented Mar 26, 2024

Oh, I forgot to comment here, but I tested again after my last comment and it seemed to fail with concurrently. In our package.json, the test:e2e calls concurrently

"test:e2e": "cross-env FUSEKI_PORT=\"${FUSEKI_PORT:=3030}\" PORT=\"${PORT:=8080}\" 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 $@'",

I found other issues from users with problems using concurrently+Windows

I will try again next time I boot on Windows, but if anyone needs to run the tests on windows right now, it'd be simpler to just run on different terminals yarn serve:fuseki, yarn dev, and npx cypress run.

@OyvindLGjesdal OyvindLGjesdal linked a pull request Apr 10, 2024 that will close this issue
4 tasks
OyvindLGjesdal added a commit to OyvindLGjesdal/jena that referenced this issue Apr 10, 2024
OyvindLGjesdal added a commit to OyvindLGjesdal/jena that referenced this issue May 26, 2024
OyvindLGjesdal added a commit to OyvindLGjesdal/jena that referenced this issue May 26, 2024
… 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
@OyvindLGjesdal
Copy link
Contributor

This was more tinkering than I anticipated for getting something to work.

There is a new dev dependency for fixing this: run-script-os (runs OS-specific commands, in this case *nix for mac + linux, and windows) https://github.com/charlesguse/run-script-os#readme
Dependency has MIT license and looks used, but hasn’t been updated in some time.

Passing on windows, passing on MacOS, passing on Ubuntu

Some additional notes:

jena-fuseki-ui % yarn run test:e2e
yarn run v1.22.22
$ run-script-os
$ cross-env FUSEKI_PORT="${FUSEKI_PORT:=3030}" PORT="${PORT:=8080}" 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 $@"
$ /Users/oyvindlgjesdal/repos/apache/jena/jena-fuseki2/jena-fuseki-ui/node_modules/.bin/wait-on 'http://localhost:3030/$/ping'
$ nodemon src/services/mock/json-server.js
$ /Users/oyvindlgjesdal/repos/apache/jena/jena-fuseki2/jena-fuseki-ui/node_modules/.bin/wait-on http-get://localhost:8080/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
[SERVER] HEAD /$/ping 200 3.360 ms - 40
$ vite
[SERVER] [nodemon] restarting due to changes...
[SERVER] [nodemon] starting `node src/services/mock/json-server.js`
[SERVER] JSON Server is running
[SERVER] [nodemon] restarting due to changes...
[SERVER] [nodemon] starting `node src/services/mock/json-server.js`
[CLIENT] Re-optimizing dependencies because lockfile has changed
[CLIENT] 
[CLIENT]   VITE v5.2.11  ready in 2875 ms
[CLIENT] 
[CLIENT]   ➜  Local:   http://localhost:8080/
[CLIENT]   ➜  Network: use --host to expose
[SERVER] JSON Server is running
[TESTS] It looks like this is your first time using Cypress: 13.10.0
[TESTS] 
[TESTS] [STARTED] Task without title.
[TESTS] [TITLE]  Verified Cypress! /Users/oyvindlgjesdal/Library/Caches/Cypress/13.10.0/Cypress.app
[TESTS] [SUCCESS]  Verified Cypress! /Users/oyvindlgjesdal/Library/Caches/Cypress/13.10.0/Cypress.app
[TESTS] 
[TESTS] Opening Cypress...
[TESTS] 
[TESTS] DevTools listening on ws://127.0.0.1:54976/devtools/browser/10852f72-0c11-4a47-8cbc-ef41829445e5
[TESTS] 
[TESTS] ====================================================================================================
[TESTS] 
[TESTS]   (Run Starting)
[TESTS] 
[TESTS]   ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
[TESTS]   │ Cypress:        13.10.0                                                                        │
[TESTS]   │ Browser:        Electron 118 (headless)                                                        │
[TESTS]   │ Node Version:   v20.12.2 (/Users/oyvindlgjesdal/.nvm/versions/node/v20.12.2/bin/node)          │
[TESTS]   │                 m                                                                              │
[TESTS]   │ Specs:          3 found (datasets.cy.js, query.cy.js, upload.cy.js)                            │
[TESTS]   │ Searched:       tests/e2e/specs/**/*.cy.{js,jsx,ts,tsx}                                        │
[TESTS]   └────────────────────────────────────────────────────────────────────────────────────────────────┘
[TESTS] 
[TESTS] 
[TESTS] ────────────────────────────────────────────────────────────────────────────────────────────────────
[TESTS]                                                                                                     
[TESTS]   Running:  datasets.cy.js                                                                  (1 of 3)
[SERVER] [nodemon] restarting due to changes...
[SERVER] [nodemon] starting `node src/services/mock/json-server.js`
[SERVER] JSON Server is running
[SERVER] [nodemon] restarting due to changes...
[SERVER] [nodemon] starting `node src/services/mock/json-server.js`
[TESTS] Generated an empty chunk: "index".
[SERVER] JSON Server is running
[TESTS] 
[TESTS] 
[TESTS]   datasets
[TESTS]     without any datasets
[SERVER] GET /tests/reset 200 1.052 ms - 2
[SERVER] GET /$/ping 200 0.369 ms - 40
[SERVER] GET /$/server 200 0.197 ms - 104
[TESTS]       ✓ Visits datasets page, also the application landing-page (337ms)
[SERVER] GET /$/ping 200 0.203 ms - 40
[SERVER] GET /$/server 304 0.129 ms - -
[SERVER] GET /tests/reset 200 0.372 ms - 2
[TESTS]       ✓ Filters without any data (323ms)
[TESTS]     after creating new datasets
[SERVER] GET /tests/reset 200 0.131 ms - 2
[SERVER] GET /$/ping 200 0.145 ms - 40
[SERVER] POST /$/datasets 200 86.474 ms - 2
[SERVER] GET /$/server 200 0.173 ms - -
[SERVER] POST /$/datasets 200 0.571 ms - 2
[SERVER] GET /$/server 200 0.324 ms - -
[SERVER] POST /$/datasets 200 0.401 ms - 2
[SERVER] GET /$/server 200 0.192 ms - -
[SERVER] POST /$/datasets 200 0.436 ms - 2
[SERVER] GET /$/server 200 0.202 ms - -
[SERVER] POST /$/datasets 200 0.419 ms - 2
[SERVER] GET /$/server 200 0.229 ms - -
[SERVER] POST /$/datasets 200 0.675 ms - 2
[SERVER] GET /$/server 200 0.208 ms - -
[SERVER] POST /$/datasets 200 0.525 ms - 2
[SERVER] GET /$/server 200 0.259 ms - -
[SERVER] POST /$/datasets 200 0.521 ms - 2
[SERVER] GET /$/server 200 0.221 ms - -
[SERVER] POST /$/datasets 200 0.637 ms - 2
[SERVER] GET /$/server 200 0.236 ms - -
[SERVER] POST /$/datasets 200 0.493 ms - 2
[SERVER] GET /$/server 200 0.289 ms - -
[SERVER] POST /$/datasets 200 0.393 ms - 2
[SERVER] GET /$/server 200 0.245 ms - -
[SERVER] GET /$/server 304 0.175 ms - -
[SERVER] GET /$/stats/a 200 0.274 ms - -
[SERVER] GET /a/sparql?query=select+(count(*)+as+%3Fcount)+%7B%3Fs+%3Fp+%3Fo%7D 200 0.176 ms - 259
[SERVER] GET /a/sparql?query=select+%3Fg+(count(*)+as+%3Fcount)+%7Bgraph+%3Fg+%7B%3Fs+%3Fp+%3Fo%7D%7D+group+by+%3Fg 200 0.067 ms - 103
[SERVER] GET /a/data?graph=default 200 0.164 ms - 257
[TESTS]       ✓ Edits the graph (3794ms)
[SERVER] GET /$/ping 200 0.148 ms - 40
[SERVER] GET /$/server 304 0.185 ms - -
[TESTS]       ✓ Visits datasets page (123ms)
[SERVER] GET /$/ping 200 0.150 ms - 40
[SERVER] GET /$/server 304 0.161 ms - -
[TESTS]       ✓ Uses the table pagination (188ms)
[SERVER] GET /$/ping 200 0.224 ms - 40
[SERVER] GET /$/server 304 0.138 ms - -
[TESTS]       ✓ Sorts the table (287ms)
[SERVER] GET /$/ping 200 0.149 ms - 40
[SERVER] GET /$/server 200 0.201 ms - -
[TESTS]       ✓ Filters the table (365ms)
[SERVER] GET /$/ping 200 0.152 ms - 40
[SERVER] GET /$/server 304 0.180 ms - -
[SERVER] POST /$/datasets 409 0.554 ms - 37
[TESTS]       ✓ Cannot add two datasets with the same name (450ms)
[SERVER] GET /$/ping 200 0.332 ms - 40
[SERVER] GET /$/server 200 0.175 ms - -
[SERVER] GET /$/stats/a 304 0.160 ms - -
[SERVER] GET /a/sparql?query=select+(count(*)+as+%3Fcount)+%7B%3Fs+%3Fp+%3Fo%7D 304 0.165 ms - -
[SERVER] GET /a/sparql?query=select+%3Fg+(count(*)+as+%3Fcount)+%7Bgraph+%3Fg+%7B%3Fs+%3Fp+%3Fo%7D%7D+group+by+%3Fg 304 0.090 ms - -
[SERVER] GET /$/stats/a 304 0.124 ms - -
[SERVER] GET /tests/reset 200 0.166 ms - 2
[TESTS]       ✓ Visualizes the dataset information (Info View, tab) (332ms)
[TESTS] 
[TESTS] 
[TESTS]   9 passing (6s)
[TESTS] 
[TESTS] 
[TESTS]   (Results)
[TESTS] 
[TESTS]   ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
[TESTS]   │ Tests:        9                                                                                │
[TESTS]   │ Passing:      9                                                                                │
[TESTS]   │ Failing:      0                                                                                │
[TESTS]   │ Pending:      0                                                                                │
[TESTS]   │ Skipped:      0                                                                                │
[TESTS]   │ Screenshots:  0                                                                                │
[TESTS]   │ Video:        false                                                                            │
[TESTS]   │ Duration:     6 seconds                                                                        │
[TESTS]   │ Spec Ran:     datasets.cy.js                                                                   │
[TESTS]   └────────────────────────────────────────────────────────────────────────────────────────────────┘
[TESTS] 
[TESTS] 
[TESTS] ────────────────────────────────────────────────────────────────────────────────────────────────────
[TESTS]                                                                                                     
[TESTS]   Running:  query.cy.js                                                                     (2 of 3)
[TESTS] 
[TESTS] 
[TESTS]   Query
[SERVER] GET /tests/reset 200 0.121 ms - 2
[SERVER] GET /$/ping 200 0.188 ms - 40
[SERVER] POST /$/datasets 200 0.480 ms - 2
[SERVER] GET /$/server 200 0.169 ms - -
[SERVER] GET /$/server 200 0.166 ms - -
[SERVER] GET /$/stats/skosmos 200 0.171 ms - -
[SERVER] GET /tests/reset 200 0.171 ms - 2
[TESTS]     ✓ Uses the correct SPARQL Endpoint (1333ms)
[SERVER] GET /tests/reset 200 0.127 ms - 2
[SERVER] GET /$/ping 200 0.233 ms - 40
[SERVER] POST /$/datasets 200 0.781 ms - 2
[SERVER] GET /$/server 200 0.161 ms - -
[SERVER] GET /$/server 304 0.151 ms - -
[SERVER] GET /$/stats/skosmos 304 0.178 ms - -
[SERVER] GET /tests/reset 200 0.128 ms - 2
[TESTS]     ✓ Can resize the query editor (856ms)
[TESTS] 
[TESTS] 
[TESTS]   2 passing (2s)
[TESTS] 
[TESTS] 
[TESTS]   (Results)
[TESTS] 
[TESTS]   ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
[TESTS]   │ Tests:        2                                                                                │
[TESTS]   │ Passing:      2                                                                                │
[TESTS]   │ Failing:      0                                                                                │
[TESTS]   │ Pending:      0                                                                                │
[TESTS]   │ Skipped:      0                                                                                │
[TESTS]   │ Screenshots:  0                                                                                │
[TESTS]   │ Video:        false                                                                            │
[TESTS]   │ Duration:     2 seconds                                                                        │
[TESTS]   │ Spec Ran:     query.cy.js                                                                      │
[TESTS]   └────────────────────────────────────────────────────────────────────────────────────────────────┘
[TESTS] 
[TESTS] 
[TESTS] ────────────────────────────────────────────────────────────────────────────────────────────────────
[TESTS]                                                                                                     
[TESTS]   Running:  upload.cy.js                                                                    (3 of 3)
[TESTS] 
[TESTS] 
[TESTS]   upload
[SERVER] GET /tests/reset 200 0.124 ms - 2
[SERVER] GET /$/ping 200 0.113 ms - 40
[SERVER] POST /$/datasets 200 0.657 ms - 2
[SERVER] GET /$/server 200 0.159 ms - -
[SERVER] GET /$/server 304 0.131 ms - -
[SERVER] GET /$/stats/skosmos 200 0.155 ms - -
[SERVER] GET /tests/reset 200 0.121 ms - 2
[TESTS]     ✓ displays an empty progress bar by default (726ms)
[SERVER] GET /tests/reset 200 0.115 ms - 2
[SERVER] GET /$/ping 200 0.199 ms - 40
[SERVER] POST /$/datasets 200 0.528 ms - 2
[SERVER] GET /$/server 304 0.169 ms - -
[SERVER] GET /$/server 304 0.175 ms - -
[SERVER] GET /$/stats/skosmos 304 0.154 ms - -
[SERVER] GET /tests/reset 200 0.220 ms - 2
[TESTS]     ✓ displays the progress for success and failure (847ms)
[TESTS] 
[TESTS] 
[TESTS]   2 passing (2s)
[TESTS] 
[TESTS] 
[TESTS]   (Results)
[TESTS] 
[TESTS]   ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
[TESTS]   │ Tests:        2                                                                                │
[TESTS]   │ Passing:      2                                                                                │
[TESTS]   │ Failing:      0                                                                                │
[TESTS]   │ Pending:      0                                                                                │
[TESTS]   │ Skipped:      0                                                                                │
[TESTS]   │ Screenshots:  0                                                                                │
[TESTS]   │ Video:        false                                                                            │
[TESTS]   │ Duration:     1 second                                                                         │
[TESTS]   │ Spec Ran:     upload.cy.js                                                                     │
[TESTS]   └────────────────────────────────────────────────────────────────────────────────────────────────┘
[TESTS] 
[TESTS] 
[TESTS] ====================================================================================================
[TESTS] 
[TESTS]   (Run Finished)
[TESTS] 
[TESTS] 
[TESTS]        Spec                                              Tests  Passing  Failing  Pending  Skipped  
[TESTS]   ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
[TESTS]   │ ✔  datasets.cy.js                           00:06        9        9        -        -        - │
[TESTS]   ├────────────────────────────────────────────────────────────────────────────────────────────────┤
[TESTS]   │ ✔  query.cy.js                              00:02        2        2        -        -        - │
[TESTS]   ├────────────────────────────────────────────────────────────────────────────────────────────────┤
[TESTS]   │ ✔  upload.cy.js                             00:01        2        2        -        -        - │
[TESTS]   └────────────────────────────────────────────────────────────────────────────────────────────────┘
[TESTS]     ✔  All specs passed!                        00:10       13       13        -        -        -  
[TESTS] 
[TESTS] yarn wait-on http-get://localhost:8080/index.html && cypress run  exited with code 0
--> Sending SIGTERM to other processes..
[SERVER] yarn run serve:fuseki exited with code 1
--> Sending SIGTERM to other processes..
[CLIENT] yarn wait-on http://localhost:3030/$/ping && yarn run dev exited with code SIGTERM
✨  Done in 32.92s.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Fuseki UI help wanted Pull requests welcome.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants