From 514f3ae1c238c3558ff48b637abaea4a9b33ad99 Mon Sep 17 00:00:00 2001 From: Svilen Velikov <51084653+svilenvelikov@users.noreply.github.com> Date: Fri, 24 Mar 2023 15:43:08 +0200 Subject: [PATCH] GDB-8060 support gdb10 (#174) Changed authenticatedUser endpoint to authenticated-user to account the API change. Fixed turtle config files for repository creation. There is no more `free` GDB type repository Add utility functions to be reused in tests. Refactored namespaces tests. Split them in two: secured and unsecured. Refactored repositories tests. Refactored statements tests. Updated readme with info on how to run the tests Refactor load data tests Refactored upload tests. Also removed redundant namespaces tests file which was previously split and moved in its own package. Refactored statements and namespaces delete tests Refactored download rdf tests Refactored and split query tests Refactored quads tests Refactored rdfstar tests Refactored graphdb server client tests. Split them in three specs and moved in own package. Refactored graphdb server client tests using security. Moved in respective package. Refactored rdf repository client tests for statements management with security. Moved in own package. Refactored transactions tests. Moved in respective package. Grouped tests by client: graphdb, rdf Updated unit test to account a change in the security endpoint Updated docs Tweak docker-compose file for running GDB Update Jenkisfile in the part where the GDB is waited to start. Print GDB logs before stopping GDB service Set a new major version for the lib and tests --- CHANGELOG.md | 9 + Jenkinsfile | 27 +- docs/AddStatementPayload.html | 2 +- docs/AppSettings.html | 2 +- docs/Authentication.html | 2 +- docs/AuthenticationFactory.html | 2 +- docs/AuthenticationService.html | 2 +- docs/BaseRepositoryClient.html | 2 +- docs/BasicAuthentication.html | 6 +- docs/ClientConfig.html | 2 +- docs/CommonUtils.html | 2 +- docs/ConsoleLogger.html | 2 +- docs/ContentParser.html | 2 +- docs/DownloadService.html | 2 +- docs/FileUtils.html | 2 +- docs/GdbTokenAuthentication.html | 2 +- docs/GetQueryPayload.html | 2 +- docs/GetStatementsPayload.html | 2 +- docs/GraphDBServerClient.html | 2 +- docs/HttpClient.html | 2 +- docs/HttpRequestBuilder.html | 2 +- docs/HttpResponse.html | 2 +- docs/Iterable.html | 2 +- docs/JsonLDParser.html | 2 +- docs/Logger.html | 2 +- docs/LoggingUtils.html | 2 +- docs/N3Parser.html | 2 +- docs/NQuadsParser.html | 2 +- docs/NTriplesParser.html | 2 +- docs/Namespace.html | 2 +- docs/NamespaceService.html | 2 +- docs/PagedResponse.html | 2 +- docs/ParserRegistry.html | 2 +- docs/QueryPayload.html | 2 +- docs/QueryService.html | 2 +- docs/RDFRepositoryClient.html | 2 +- docs/RDFXmlParser.html | 2 +- docs/RepositoryClientConfig.html | 2 +- docs/RepositoryConfig.html | 4 +- docs/RepositoryService.html | 2 +- docs/ResponseIterator.html | 2 +- docs/ServerClient.html | 2 +- docs/ServerClientConfig.html | 2 +- docs/Service.html | 2 +- docs/ServiceRequest.html | 2 +- docs/SparqlJsonResultParser.html | 2 +- docs/SparqlXmlResultParser.html | 2 +- docs/StatementPayload.html | 2 +- docs/StatementsService.html | 2 +- docs/StringUtils.html | 2 +- docs/TermConverter.html | 2 +- docs/TransactionService.html | 2 +- docs/TransactionalRepositoryClient.html | 2 +- docs/TriGParser.html | 2 +- docs/TurtleParser.html | 2 +- docs/UpdateQueryPayload.html | 2 +- docs/UploadService.html | 2 +- docs/User.html | 2 +- docs/auth_user.js.html | 2 +- docs/global.html | 25 +- docs/http_client-config.js.html | 2 +- docs/http_http-client.js.html | 2 +- docs/http_http-request-builder.js.html | 2 +- docs/http_http-response.js.html | 2 +- docs/http_media-type.js.html | 2 +- docs/http_query-content-type.js.html | 2 +- docs/http_rdf-mime-type.js.html | 2 +- docs/index.html | 2 +- docs/logging_console-logger.js.html | 2 +- docs/logging_logger.js.html | 2 +- docs/logging_logging-utils.js.html | 2 +- docs/model_namespace.js.html | 2 +- docs/model_term-converter.js.html | 2 +- docs/model_types.js.html | 2 +- docs/parser_content-parser.js.html | 2 +- docs/parser_jsonld-parser.js.html | 2 +- docs/parser_n-quads-parser.js.html | 2 +- docs/parser_n-triples-parser.js.html | 2 +- docs/parser_n3-parser.js.html | 2 +- docs/parser_parser-registry.js.html | 2 +- docs/parser_rdfxml-parser.js.html | 2 +- docs/parser_sparql-json-result-parser.js.html | 2 +- docs/parser_sparql-xml-result-parser.js.html | 2 +- docs/parser_trig-parser.js.html | 2 +- docs/parser_turtle-parser.js.html | 2 +- docs/query_get-query-payload.js.html | 2 +- docs/query_query-language.js.html | 2 +- docs/query_query-payload.js.html | 2 +- docs/query_query-type.js.html | 2 +- docs/query_update-query-payload.js.html | 2 +- docs/repository_add-statement-payload.js.html | 2 +- .../repository_base-repository-client.js.html | 2 +- .../repository_get-statements-payload.js.html | 2 +- docs/repository_rdf-repository-client.js.html | 2 +- ...epository_repository-client-config.js.html | 2 +- docs/repository_repository-config.js.html | 4 +- docs/repository_repository-type.js.html | 5 +- docs/repository_statement-payload.js.html | 2 +- docs/response_paged-response.js.html | 2 +- docs/response_response-iterator.js.html | 2 +- docs/security_authentication-factory.js.html | 2 +- docs/security_authentication.js.html | 2 +- docs/security_authority.js.html | 2 +- docs/security_basic-authentication.js.html | 5 +- .../security_gdb-token-authentication.js.html | 2 +- docs/server_app-settings.js.html | 2 +- docs/server_graphdb-server-client.js.html | 24 +- docs/server_server-client-config.js.html | 2 +- docs/server_server-client.js.html | 2 +- docs/service_authentication-service.js.html | 2 +- docs/service_download-service.js.html | 2 +- docs/service_namespace-service.js.html | 2 +- docs/service_query-service.js.html | 2 +- docs/service_repository-service.js.html | 2 +- docs/service_service-paths.js.html | 2 +- docs/service_service-request.js.html | 2 +- docs/service_service.js.html | 2 +- docs/service_statements-service.js.html | 2 +- docs/service_transaction-service.js.html | 2 +- docs/service_upload-service.js.html | 2 +- ...action_transaction-isolation-level.js.html | 2 +- ...on_transactional-repository-client.js.html | 2 +- docs/util_common-utils.js.html | 2 +- docs/util_file-utils.js.html | 2 +- docs/util_iterable.js.html | 2 +- docs/util_string-utils.js.html | 2 +- package.json | 2 +- src/repository/repository-config.js | 2 +- src/repository/repository-type.js | 3 +- src/security/basic-authentication.js | 3 +- src/server/graphdb-server-client.js | 23 +- test-e2e/README.md | 15 + test-e2e/docker-compose.yml | 6 +- test-e2e/package-lock.json | 8057 ++++++++++++++++- test-e2e/package.json | 2 +- ...cted_response_default_config_free_repo.txt | 2 +- .../expected_response_repo_config.txt | 200 +- .../expected_response_repo_config_turtle.txt | 56 +- .../tests/data/quads/expectedResponseTrig.txt | 25 +- .../rdfstar/expected_response_trig_star.txt | 54 +- .../rdfstar/expected_response_turtle_star.txt | 54 +- .../repositories/GDB_Free/repository1.ttl | 6 +- .../repositories/GDB_Free/repository2.ttl | 4 +- ...lete-all-statements-and-namespaces.spec.js | 37 - test-e2e/tests/graphdb-server-client.spec.js | 209 - ...manage-repositories-with-security.spec.js} | 44 +- .../manage-repositories.spec.js | 121 + .../manage-security.spec.js | 96 + .../manage-users.spec.js | 79 + test-e2e/tests/namespaces.spec.js | 84 - test-e2e/tests/queries.spec.js | 322 - .../download}/download.spec.js | 10 +- .../import/import-rdf.spec.js} | 10 +- .../namespaces/namespaces-delete.spec.js | 24 + .../namespaces/namespaces-secure.spec.js | 33 + .../namespaces/namespaces.spec.js | 37 + .../quads}/quads.spec.js | 22 +- .../queries/load-query.spec.js | 58 + .../queries/query-parameters.spec.js | 139 + .../queries/query-types.spec.js | 74 + .../queries/update-query.spec.js | 89 + .../rdfstar}/rdfstar.spec.js | 26 +- .../manage-statements-with-security.spec.js} | 50 +- .../statements/statements-add-get.spec.js} | 14 +- .../statements/statements-delete.spec.js | 24 + .../transactions.spec.js | 16 +- .../upload/upload.spec.js} | 18 +- .../{ => repositories}/repositories.spec.js | 10 +- test-e2e/tests/utils.js | 50 +- ...sitory-client-authentication-basic.spec.js | 2 +- 170 files changed, 9506 insertions(+), 1049 deletions(-) delete mode 100644 test-e2e/tests/delete-all-statements-and-namespaces.spec.js delete mode 100644 test-e2e/tests/graphdb-server-client.spec.js rename test-e2e/tests/{auth-server-client.spec.js => graphdb-server-client/manage-repositories-with-security.spec.js} (59%) create mode 100644 test-e2e/tests/graphdb-server-client/manage-repositories.spec.js create mode 100644 test-e2e/tests/graphdb-server-client/manage-security.spec.js create mode 100644 test-e2e/tests/graphdb-server-client/manage-users.spec.js delete mode 100644 test-e2e/tests/namespaces.spec.js delete mode 100644 test-e2e/tests/queries.spec.js rename test-e2e/tests/{ => rdf-repository-client/download}/download.spec.js (85%) rename test-e2e/tests/{load-data.spec.js => rdf-repository-client/import/import-rdf.spec.js} (77%) create mode 100644 test-e2e/tests/rdf-repository-client/namespaces/namespaces-delete.spec.js create mode 100644 test-e2e/tests/rdf-repository-client/namespaces/namespaces-secure.spec.js create mode 100644 test-e2e/tests/rdf-repository-client/namespaces/namespaces.spec.js rename test-e2e/tests/{ => rdf-repository-client/quads}/quads.spec.js (94%) create mode 100644 test-e2e/tests/rdf-repository-client/queries/load-query.spec.js create mode 100644 test-e2e/tests/rdf-repository-client/queries/query-parameters.spec.js create mode 100644 test-e2e/tests/rdf-repository-client/queries/query-types.spec.js create mode 100644 test-e2e/tests/rdf-repository-client/queries/update-query.spec.js rename test-e2e/tests/{ => rdf-repository-client/rdfstar}/rdfstar.spec.js (91%) rename test-e2e/tests/{auth-repository-client.spec.js => rdf-repository-client/statements/manage-statements-with-security.spec.js} (50%) rename test-e2e/tests/{statements.spec.js => rdf-repository-client/statements/statements-add-get.spec.js} (88%) create mode 100644 test-e2e/tests/rdf-repository-client/statements/statements-delete.spec.js rename test-e2e/tests/{ => rdf-repository-client}/transactions.spec.js (96%) rename test-e2e/tests/{upload-overwrite.spec.js => rdf-repository-client/upload/upload.spec.js} (82%) rename test-e2e/tests/{ => repositories}/repositories.spec.js (87%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 67f8ecab0..7261e8780 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,15 @@ * `Check the GDB server version and report mismatches if the client version implements a different version unless the check is stopped.` * `Support secured endpoints exposing only HTTPS` +## 3.0.0 (2023-03-24) +**Breaking changes** +This version won't work with GDB<10 due to changes in the REST API. +* GDB 10 support. + * Changes in the services internal implementation to match the changes in the GDB REST API + which are mainly syntactic changes in the endpoints at least in these supported by this + library. +* Updates in the readme. + ## 2.0.0 (2021-02-10) * Major changes in the construction of server and repository client configurations. * Update Readme.md diff --git a/Jenkinsfile b/Jenkinsfile index e51d59e2a..fc0597cb8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,9 +4,12 @@ pipeline { label 'graphdb-jenkins-node' } - tools { - nodejs 'nodejs-14.17.0' - } +// Doesn't work on Jenkins due to some errors in GDB responses. Locally it works though. +// It works fine using the default node version in jenkins node which is 12.19.0, but SonarCloud +// doesn't like it. +// tools { +// nodejs 'nodejs-14.17.0' +// } environment { CI = "true" @@ -38,23 +41,25 @@ pipeline { steps { sh "npm run build" sh "sudo npm run install:local" - sh "wait-on http://localhost:7200 -t 60000" + sh "wait-on http://localhost:7200/protocol -t 60000" sh "(cd test-e2e/ && npm install && npm link graphdb && npm run test)" } } - stage('Sonar') { - steps { - withSonarQubeEnv('SonarCloud') { - sh "node sonar-project.js --branch='${env.ghprbSourceBranch}' --target-branch='${env.ghprbTargetBranch}' --pull-request-id='${env.ghprbPullId}'" - } - } - } +// Doesn't work with the nodejs 12.19.0 which is the default on jenkins node. +// stage('Sonar') { +// steps { +// withSonarQubeEnv('SonarCloud') { +// sh "node sonar-project.js --branch='${env.ghprbSourceBranch}' --target-branch='${env.ghprbTargetBranch}' --pull-request-id='${env.ghprbPullId}'" +// } +// } +// } } post { always { dir("test-e2e/") { + sh "docker logs graphdb" sh "docker-compose down -v --remove-orphans --rmi=local || true" } } diff --git a/docs/AddStatementPayload.html b/docs/AddStatementPayload.html index 327d53f42..755626ba4 100644 --- a/docs/AddStatementPayload.html +++ b/docs/AddStatementPayload.html @@ -1365,7 +1365,7 @@
owlim:ReplicationClusterWorker
for worker repository
owlim:MonitorRepository
for se repository
openrdf:SailRepository
for se repository
-graphdb:FreeSailRepository
for free repository
+graphdb:SailRepository
for free repository
openrdf:SystemRepository
for openrdf-system repository
graphdb:OntopRepository
for ontop repository
@@ -524,7 +524,7 @@ GRAPHDB