jena icon indicating copy to clipboard operation
jena copied to clipboard

GH-1611: supply initial value for acceptHeaderGraph to requestConfig

Open OyvindLGjesdal opened this issue 1 year ago • 3 comments

GitHub issue resolved #1611

Pull request Description:

The type is first set on change, due to being updated on the watch phase. Adding it to requestConfig sets it to turtle initially. contentTypeGraph variable was already set as the initial value for turtle, so reusing variable.

local fuseki with

Have also changed to other serializations sucessfully.

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.

OyvindLGjesdal avatar Jun 08 '24 22:06 OyvindLGjesdal

Thanks @OyvindLGjesdal ! Change looks good, let me just check if it needs a test (I can write a quick one if so).

kinow avatar Jun 09 '24 08:06 kinow

(BTW, the unit test for a view does not affect the time to run the unit tests, which remains ridiculously fast, thanks to Vite:)

yarn run v1.22.19
$ vitest run --environment jsdom

 RUN  v1.6.0 /home/kinow/Development/java/jena/jena/jena-fuseki2/jena-fuseki-ui

 ✓ tests/unit/utils/query.spec.js (1)
 ✓ tests/unit/components/dataset/pagination.vue.spec.js (4)
 ✓ tests/unit/components/dataset/tablelisting.vue.spec.js (2)
 ✓ tests/unit/services/fuseki.service.spec.js (20)
 ✓ tests/unit/components/serverstatus.vue.spec.js (3)
 ✓ tests/unit/views/dataset/query.vue.spec.js (1) 323ms

 Test Files  6 passed (6)
      Tests  31 passed (31)
   Start at  16:02:43
   Duration  3.44s (transform 1.35s, setup 1ms, collect 3.45s, tests 767ms, environment 5.20s, prepare 1.73s)

Done in 4.50s.

And coverage before (the reporting needs to be improved as it doesn't show what's not tested):

--------------------|---------|----------|---------|---------|---------------------------------
File                | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s               
--------------------|---------|----------|---------|---------|---------------------------------
All files           |   95.27 |     89.1 |   78.57 |   95.27 |                                 
 components         |     100 |      100 |     100 |     100 |                                 
  ServerStatus.vue  |     100 |      100 |     100 |     100 |                                 
 components/dataset |   92.39 |    79.62 |    64.7 |   92.39 |                                 
  JenaTable.vue     |   94.21 |    43.75 |   71.42 |   94.21 | 176,187-193,199,216,222,225-227 
  JenaTableTh.vue   |   84.44 |       80 |      60 |   84.44 | 58-59,76-87                     
  Pagination.vue    |     100 |      100 |   72.22 |     100 |                                 
  TableListing.vue  |   82.39 |       50 |      25 |   82.39 | 1-25                            
 events             |     100 |      100 |     100 |     100 |                                 
  index.js          |     100 |      100 |     100 |     100 |                                 
 model              |     100 |      100 |     100 |     100 |                                 
  server.status.js  |     100 |      100 |     100 |     100 |                                 
 services           |     100 |      100 |     100 |     100 |                                 
  fuseki.service.js |     100 |      100 |     100 |     100 |                                 
 utils              |     100 |      100 |     100 |     100 |                                 
  query.js          |     100 |      100 |     100 |     100 |                                 
--------------------|---------|----------|---------|---------|---------------------------------

and after:

--------------------------------------|---------|----------|---------|---------|---------------------------------------------
File                                   | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                           
---------------------------------------|---------|----------|---------|---------|---------------------------------------------
All files                              |   84.37 |     85.6 |   62.65 |   84.37 |                                             
 components                            |     100 |      100 |     100 |     100 |                                             
  ServerStatus.vue                     |     100 |      100 |     100 |     100 |                                             
 components/dataset                    |   93.07 |    79.62 |    64.7 |   93.07 |                                             
  JenaTable.vue                        |   94.21 |    43.75 |   71.42 |   94.21 | 176,187-193,199,216,222,225-227             
  JenaTableTh.vue                      |   84.44 |       80 |      60 |   84.44 | 58-59,76-87                                 
  Menu.vue                             |     100 |      100 |     100 |     100 |                                             
  Pagination.vue                       |     100 |      100 |   72.22 |     100 |                                             
  TableListing.vue                     |   82.39 |       50 |      25 |   82.39 | 1-25                                        
 events                                |     100 |      100 |     100 |     100 |                                             
  index.js                             |     100 |      100 |     100 |     100 |                                             
 mixins                                |   73.68 |       60 |   42.85 |   73.68 |                                             
  current-dataset-navigation-guards.js |    73.8 |      100 |       0 |    73.8 | 27-30,33-36,39-41                           
  current-dataset.js                   |   73.61 |       60 |      75 |   73.61 | 48-56,61-70                                 
 model                                 |     100 |      100 |     100 |     100 |                                             
  server.status.js                     |     100 |      100 |     100 |     100 |                                             
 services                              |     100 |      100 |     100 |     100 |                                             
  fuseki.service.js                    |     100 |      100 |     100 |     100 |                                             
 utils                                 |   94.87 |      100 |   33.33 |   94.87 |                                             
  index.js                             |   83.33 |      100 |       0 |   83.33 | 19-20,23-24                                 
  query.js                             |     100 |      100 |     100 |     100 |                                             
 views/dataset                         |   55.71 |    73.68 |   27.77 |   55.71 |                                             
  Query.vue                            |   55.71 |    73.68 |   27.77 |   55.71 | ...,336-338,341-343,346-349,355-361,377-387 
---------------------------------------|---------|----------|---------|---------|---------------------------------------------

At least we got a few new files now being covered by this unit test.

kinow avatar Jun 09 '24 14:06 kinow

Thank you for the review and added tests. I did two cosmetic force pushes earlier and I still managed to have a formatting issue left in a one-line PR 🤓

OyvindLGjesdal avatar Jun 09 '24 19:06 OyvindLGjesdal

LGTM - sorry for the delay reviewing.

afs avatar Jul 09 '24 10:07 afs