OyvindLGjesdal commented on issue #2344:
URL: https://github.com/apache/jena/issues/2344#issuecomment-2132421238

   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](https://github.com/OyvindLGjesdal/jena/actions/runs/9246460015),  
[passing on 
MacOS](https://github.com/OyvindLGjesdal/jena/actions/runs/9246459805), 
[passing on 
Ubuntu](https://github.com/OyvindLGjesdal/jena/actions/runs/9246459476/job/25434029658)
   
   Some additional notes:
   * set /a 
(https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/set_1)
 is used to set a numerical expression with bitwise exclusive or on the port 
set by maven (or undefined, which falls back to 0) I haven't checked if this 
works on a windows machine, by calling yarn run test:e2e in the jena-fuseki-ui 
folder, since I don’t currently have one available.
   * Github windows CI uses poweshell as the default shell since 2019
   * windows github actions calls maven using bash -c (shell can be configured 
shell parameter, which would maybe be cleaner? 
https://github.blog/changelog/2019-10-17-github-actions-default-shell-on-windows-runners-is-changing-to-powershell/
   * yarn (1) calls cmd as default when running from windows. Tried adding it 
in pom.xml using yarn config set script-shell bash, in order to use the same 
test:e2e for all scripts, but didn’t get it to work.
   * Tests pass locally on my Mac but gives a bad exit code when cleaning up:
   
   
   ```bash
   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.
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to