Skip to content
Permalink
Browse files
build: BAZEL to SBT migration (DEV-508) (#2002)
* bring sbt configuration back

* wip: update dependencies

* fix deprecation warnings

* add ZIO + update some deps + cleanup

* add missing deps from current setup

* fix compilation error

* fix more compilation errors

* remove deps not needed for compilation

* build: add running build and test through SBT on Github

* bring back all deps

* fixing paths to test files (ongoing)

* fixing paths to test files (ongoing)

* wip: fix test

* add building of docker images on github CI

* wip: fix more tests

* wip: fix more tests

* fix sbt info regarding docker image

* wip: fix more tests

* fix bazel build

* ignore server version test

* fix test

* wip: fix more tests

* ignored 3 tests

* fix more tests

* tweak corespec

* tweak base specs

* tweak cache spec

* fix cache spec

* fix rejeccting route test

* fix cache spec

* fix sbt

* fix client test data (ongoing)

* fix client test data (ongoing)

* cleanup github ci

* remove redis

* fix bazel

* build dsp-api docker image through sbt

* fix buildinfo a bit

* fix buildinfo

* cleanup buildinfo

* review changes

* removed too much

* cleanup

Co-authored-by: Ivan Subotic <400790+subotic@users.noreply.github.com>
  • Loading branch information
mpro7 and subotic committed Feb 23, 2022
1 parent f1f8005 commit 38faa9eb38b77d082d2f17a7cf220408ca409b3b
Showing with 1,081 additions and 4,810 deletions.
  1. +32 −110 .github/workflows/main.yml
  2. +8 −27 .gitignore
  3. +9 −33 Makefile
  4. +1 −0 README.md
  5. +192 −0 build.sbt
  6. +1 −8 docker-compose.yml
  7. +0 −30 docker/knora-api.dockerfile
  8. +0 −45 docker/knora-api/BUILD.bazel
  9. +261 −0 project/Dependencies.scala
  10. +1 −0 project/build.properties
  11. +23 −0 project/plugins.sbt
  12. +1 −1 third_party/dependencies.bzl
  13. +0 −194 webapi/BUILD.bazel
  14. +0 −25 webapi/scripts/BUILD.bazel
  15. +2 −0 webapi/scripts/expected-client-test-data.txt
  16. +4 −7 webapi/scripts/{clear-client-test-data.sh → zap-client-test-data.sh}
  17. +3 −27 webapi/scripts/{dump-client-test-data.sh → zip-client-test-data.sh}
  18. +0 −13 webapi/src/main/resources/BUILD.bazel
  19. +1 −4 webapi/src/main/resources/application.conf
  20. +0 −15 webapi/src/main/scala/org/knora/webapi/BUILD.bazel
  21. +0 −10 webapi/src/main/scala/org/knora/webapi/annotation/BUILD.bazel
  22. +3 −11 webapi/src/main/scala/org/knora/webapi/app/ApplicationActor.scala
  23. +0 −70 webapi/src/main/scala/org/knora/webapi/app/BUILD.bazel
  24. +0 −45 webapi/src/main/scala/org/knora/webapi/contributors/BUILD.bazel
  25. +0 −19 webapi/src/main/scala/org/knora/webapi/core/BUILD.bazel
  26. +0 −17 webapi/src/main/scala/org/knora/webapi/exceptions/BUILD.bazel
  27. +0 −20 webapi/src/main/scala/org/knora/webapi/feature/BUILD.bazel
  28. +0 −16 webapi/src/main/scala/org/knora/webapi/http/BUILD.bazel
  29. +0 −18 webapi/src/main/scala/org/knora/webapi/http/directives/BUILD.bazel
  30. +0 −24 webapi/src/main/scala/org/knora/webapi/http/handler/BUILD.bazel
  31. +0 −14 webapi/src/main/scala/org/knora/webapi/http/status/BUILD.bazel
  32. +0 −15 webapi/src/main/scala/org/knora/webapi/http/version/BUILD.bazel
  33. +3 −3 webapi/src/main/scala/org/knora/webapi/http/version/ServerVersion.scala
  34. +0 −50 webapi/src/main/scala/org/knora/webapi/http/version/versioninfo/BUILD.bazel
  35. +0 −33 webapi/src/main/scala/org/knora/webapi/http/version/versioninfo/VersionInfoTemplate.scala
  36. +0 −7 webapi/src/main/scala/org/knora/webapi/http/version/versioninfo/add_build_tag.sh
  37. +0 −36 webapi/src/main/scala/org/knora/webapi/http/version/versioninfo/gen_version_info.bzl
  38. +0 −23 webapi/src/main/scala/org/knora/webapi/instrumentation/BUILD.bazel
  39. +0 −53 webapi/src/main/scala/org/knora/webapi/messages/BUILD.bazel
  40. +0 −38 webapi/src/main/scala/org/knora/webapi/responders/BUILD.bazel
  41. +0 −27 webapi/src/main/scala/org/knora/webapi/responders/v2/ontology/BUILD.bazel
  42. +0 −45 webapi/src/main/scala/org/knora/webapi/routing/BUILD.bazel
  43. +3 −5 webapi/src/main/scala/org/knora/webapi/routing/RejectingRoute.scala
  44. +8 −11 webapi/src/main/scala/org/knora/webapi/routing/VersionRoute.scala
  45. +0 −16 webapi/src/main/scala/org/knora/webapi/settings/BUILD.bazel
  46. +0 −12 webapi/src/main/scala/org/knora/webapi/settings/KnoraSettings.scala
  47. +0 −46 webapi/src/main/scala/org/knora/webapi/store/BUILD.bazel
  48. +0 −24 webapi/src/main/scala/org/knora/webapi/store/cacheservice/BUILD.bazel
  49. +0 −21 webapi/src/main/scala/org/knora/webapi/store/cacheservice/inmem/BUILD.bazel
  50. +0 −26 webapi/src/main/scala/org/knora/webapi/store/cacheservice/redis/BUILD.bazel
  51. +0 −19 webapi/src/main/scala/org/knora/webapi/store/cacheservice/serialization/BUILD.bazel
  52. +0 −15 webapi/src/main/scala/org/knora/webapi/store/cacheservice/settings/BUILD.bazel
  53. +4 −3 webapi/src/main/scala/org/knora/webapi/store/triplestore/http/HttpTriplestoreConnector.scala
  54. +0 −22 webapi/src/main/scala/org/knora/webapi/util/BUILD.bazel
  55. +0 −16 webapi/src/main/scala/org/knora/webapi/util/cache/BUILD.bazel
  56. +3 −1 webapi/src/main/scala/org/knora/webapi/util/cache/CacheUtil.scala
  57. +0 −62 webapi/src/main/twirl/BUILD.bazel
  58. +0 −13 webapi/src/test/resources/BUILD.bazel
  59. +0 −16 webapi/src/test/resources/graphdb-free.conf
  60. +0 −16 webapi/src/test/resources/graphdb-se.conf
  61. +0 −15 webapi/src/test/resources/jenatdb.conf
  62. +1 −0 webapi/src/test/resources/logback-test.xml
  63. +0 −8 webapi/src/test/resources/test.conf
  64. +2 −2 webapi/src/test/scala/org/knora/webapi/AsyncCoreSpec.scala
  65. +0 −30 webapi/src/test/scala/org/knora/webapi/BUILD.bazel
  66. +3 −3 webapi/src/test/scala/org/knora/webapi/CoreSpec.scala
  67. +22 −4 webapi/src/test/scala/org/knora/webapi/E2ESpec.scala
  68. +8 −8 webapi/src/test/scala/org/knora/webapi/ITKnoraLiveSpec.scala
  69. +5 −1 webapi/src/test/scala/org/knora/webapi/IntegrationSpec.scala
  70. +2 −2 webapi/src/test/scala/org/knora/webapi/R2RSpec.scala
  71. +0 −122 webapi/src/test/scala/org/knora/webapi/e2e/BUILD.bazel
  72. +29 −32 webapi/src/test/scala/org/knora/webapi/e2e/ClientTestDataCollector.scala
  73. +1 −1 webapi/src/test/scala/org/knora/webapi/e2e/InstanceCheckerSpec.scala
  74. +8 −17 webapi/src/test/scala/org/knora/webapi/e2e/RejectingRouteE2ESpec.scala
  75. +0 −117 webapi/src/test/scala/org/knora/webapi/e2e/admin/BUILD.bazel
  76. +0 −61 webapi/src/test/scala/org/knora/webapi/e2e/admin/lists/BUILD.bazel
  77. +2 −2 webapi/src/test/scala/org/knora/webapi/e2e/admin/lists/OldListsRouteADMFeatureE2ESpec.scala
  78. +0 −29 webapi/src/test/scala/org/knora/webapi/e2e/http/BUILD.bazel
  79. +0 −2 webapi/src/test/scala/org/knora/webapi/e2e/http/ServerVersionE2ESpec.scala
  80. +0 −220 webapi/src/test/scala/org/knora/webapi/e2e/v1/BUILD.bazel
  81. +14 −14 webapi/src/test/scala/org/knora/webapi/e2e/v1/StandoffV1R2RSpec.scala
  82. +0 −210 webapi/src/test/scala/org/knora/webapi/e2e/v2/BUILD.bazel
  83. +7 −11 webapi/src/test/scala/org/knora/webapi/e2e/v2/JSONLDHandlingV2R2RSpec.scala
  84. +9 −9 webapi/src/test/scala/org/knora/webapi/e2e/v2/ListsRouteV2R2RSpec.scala
  85. +1 −1 webapi/src/test/scala/org/knora/webapi/e2e/v2/OntologyV2R2RSpec.scala
  86. +39 −39 webapi/src/test/scala/org/knora/webapi/e2e/v2/ResourcesRouteV2E2ESpec.scala
  87. +10 −10 webapi/src/test/scala/org/knora/webapi/e2e/v2/ResponseCheckerV2Spec.scala
  88. +190 −190 webapi/src/test/scala/org/knora/webapi/e2e/v2/SearchRouteV2R2RSpec.scala
  89. +2 −6 webapi/src/test/scala/org/knora/webapi/e2e/v2/StandoffRouteV2R2RSpec.scala
  90. +4 −15 webapi/src/test/scala/org/knora/webapi/e2e/v2/ValuesRouteV2E2ESpec.scala
  91. +0 −1 webapi/src/test/scala/org/knora/webapi/http/BUILD.bazel
  92. +0 −24 webapi/src/test/scala/org/knora/webapi/http/version/BUILD.bazel
  93. +21 −0 webapi/src/test/scala/org/knora/webapi/http/version/BuildInfoSpec.scala
  94. +1 −3 webapi/src/test/scala/org/knora/webapi/http/version/ServerVersionSpec.scala
  95. +0 −23 webapi/src/test/scala/org/knora/webapi/http/version/versioninfo/BUILD.bazel
  96. +0 −29 webapi/src/test/scala/org/knora/webapi/http/version/versioninfo/VersionInfoSpec.scala
  97. +0 −25 webapi/src/test/scala/org/knora/webapi/it/BUILD.bazel
  98. +0 −78 webapi/src/test/scala/org/knora/webapi/it/v1/BUILD.bazel
  99. +2 −1 webapi/src/test/scala/org/knora/webapi/it/v1/DrawingsGodsV1ITSpec.scala
  100. +27 −27 webapi/src/test/scala/org/knora/webapi/it/v1/KnoraSipiIntegrationV1ITSpec.scala
  101. +0 −22 webapi/src/test/scala/org/knora/webapi/it/v2/BUILD.bazel
  102. +19 −20 webapi/src/test/scala/org/knora/webapi/it/v2/KnoraSipiIntegrationV2ITSpec.scala
  103. +0 −29 webapi/src/test/scala/org/knora/webapi/messages/BUILD.bazel
  104. +0 −22 webapi/src/test/scala/org/knora/webapi/messages/admin/responder/listsmessages/BUILD.bazel
  105. +0 −22 webapi/src/test/scala/org/knora/webapi/messages/admin/responder/permissionsmessages/BUILD.bazel
  106. +0 −22 webapi/src/test/scala/org/knora/webapi/messages/admin/responder/projectsmessages/BUILD.bazel
  107. +0 −25 webapi/src/test/scala/org/knora/webapi/messages/admin/responder/usersmessages/BUILD.bazel
  108. +0 −27 webapi/src/test/scala/org/knora/webapi/messages/admin/responder/valueObjects/BUILD.bazel
  109. +0 −21 webapi/src/test/scala/org/knora/webapi/messages/store/triplestoremessages/BUILD.bazel
  110. +0 −77 webapi/src/test/scala/org/knora/webapi/messages/util/BUILD.bazel
  111. +8 −8 webapi/src/test/scala/org/knora/webapi/messages/util/ConstructResponseUtilV2Spec.scala
  112. +0 −15 webapi/src/test/scala/org/knora/webapi/messages/util/rdf/BUILD.bazel
  113. +8 −8 webapi/src/test/scala/org/knora/webapi/messages/util/rdf/JsonLDUtilSpec.scala
  114. +4 −4 webapi/src/test/scala/org/knora/webapi/messages/util/rdf/KnoraResponseV2Spec.scala
  115. +13 −13 webapi/src/test/scala/org/knora/webapi/messages/util/rdf/RdfFormatUtilSpec.scala
  116. +1 −1 webapi/src/test/scala/org/knora/webapi/messages/util/rdf/RdfModelSpec.scala
  117. +13 −9 webapi/src/test/scala/org/knora/webapi/messages/util/rdf/ShaclValidatorSpec.scala
  118. +0 −103 webapi/src/test/scala/org/knora/webapi/messages/util/rdf/jenaimpl/BUILD.bazel
  119. +0 −103 webapi/src/test/scala/org/knora/webapi/messages/util/rdf/rdf4jimpl/BUILD.bazel
  120. +0 −124 webapi/src/test/scala/org/knora/webapi/messages/util/search/BUILD.bazel
  121. +0 −60 webapi/src/test/scala/org/knora/webapi/messages/util/standoff/BUILD.bazel
  122. +3 −3 webapi/src/test/scala/org/knora/webapi/messages/util/standoff/XMLUtilSpec.scala
  123. +0 −23 webapi/src/test/scala/org/knora/webapi/messages/v1/responder/permissionmessages/BUILD.bazel
  124. +0 −24 webapi/src/test/scala/org/knora/webapi/messages/v1/responder/usermessages/BUILD.bazel
  125. +0 −40 webapi/src/test/scala/org/knora/webapi/messages/v2/responder/ontologymessages/BUILD.bazel
  126. +0 −22 webapi/src/test/scala/org/knora/webapi/messages/v2/responder/resourcesmessages/BUILD.bazel
  127. +0 −10 webapi/src/test/scala/org/knora/webapi/models/BUILD.bazel
  128. +0 −26 webapi/src/test/scala/org/knora/webapi/models/filemodels/BUILD.bazel
  129. +0 −40 webapi/src/test/scala/org/knora/webapi/other/v1/BUILD.bazel
  130. +0 −22 webapi/src/test/scala/org/knora/webapi/other/v2/BUILD.bazel
  131. +0 −30 webapi/src/test/scala/org/knora/webapi/responders/BUILD.bazel
  132. +0 −113 webapi/src/test/scala/org/knora/webapi/responders/admin/BUILD.bazel
  133. +0 −136 webapi/src/test/scala/org/knora/webapi/responders/v1/BUILD.bazel
  134. +1 −1 webapi/src/test/scala/org/knora/webapi/responders/v1/ResourcesResponderV1SpecContextData.scala
  135. +0 −128 webapi/src/test/scala/org/knora/webapi/responders/v2/BUILD.bazel
  136. +0 −83 webapi/src/test/scala/org/knora/webapi/responders/v2/ontology/BUILD.bazel
  137. +3 −0 webapi/src/test/scala/org/knora/webapi/responders/v2/ontology/CacheSpec.scala
  138. +0 −41 webapi/src/test/scala/org/knora/webapi/routing/BUILD.bazel
  139. +0 −14 webapi/src/test/scala/org/knora/webapi/sharedtestdata/BUILD.bazel
  140. +0 −11 webapi/src/test/scala/org/knora/webapi/store/BUILD.bazel
  141. +0 −22 webapi/src/test/scala/org/knora/webapi/store/cacheservice/BUILD.bazel
  142. +0 −34 webapi/src/test/scala/org/knora/webapi/store/cacheservice/inmem/BUILD.bazel
  143. +0 −39 webapi/src/test/scala/org/knora/webapi/store/cacheservice/redis/BUILD.bazel
  144. +0 −32 webapi/src/test/scala/org/knora/webapi/store/cacheservice/serialization/BUILD.bazel
  145. +0 −9 webapi/src/test/scala/org/knora/webapi/store/iiif/BUILD.bazel
  146. +0 −58 webapi/src/test/scala/org/knora/webapi/store/triplestore/BUILD.bazel
  147. +0 −143 webapi/src/test/scala/org/knora/webapi/store/triplestore/upgrade/plugins/BUILD.bazel
  148. +1 −1 ...i/src/test/scala/org/knora/webapi/store/triplestore/upgrade/plugins/UpgradePluginPR1307Spec.scala
  149. +1 −1 ...i/src/test/scala/org/knora/webapi/store/triplestore/upgrade/plugins/UpgradePluginPR1322Spec.scala
  150. +1 −1 ...i/src/test/scala/org/knora/webapi/store/triplestore/upgrade/plugins/UpgradePluginPR1367Spec.scala
  151. +1 −1 ...i/src/test/scala/org/knora/webapi/store/triplestore/upgrade/plugins/UpgradePluginPR1372Spec.scala
  152. +1 −1 ...i/src/test/scala/org/knora/webapi/store/triplestore/upgrade/plugins/UpgradePluginPR1615Spec.scala
  153. +1 −1 ...i/src/test/scala/org/knora/webapi/store/triplestore/upgrade/plugins/UpgradePluginPR1746Spec.scala
  154. +1 −1 ...i/src/test/scala/org/knora/webapi/store/triplestore/upgrade/plugins/UpgradePluginPR1921Spec.scala
  155. +0 −71 webapi/src/test/scala/org/knora/webapi/util/BUILD.bazel
  156. +0 −22 webapi/src/test/scala/org/knora/webapi/util/cache/BUILD.bazel
  157. +28 −2 webapi/src/test/scala/org/knora/webapi/util/cache/CacheUtilSpec.scala
@@ -7,13 +7,18 @@ on:

jobs:
compile:
name: Build Everything
name: Build and Test
runs-on: ubuntu-latest
steps:
- name: checkout source
uses: actions/checkout@v1
with:
fetch-depth: 15
- name: Setup JDK
uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 11
- name: get current time
uses: josStorer/get-current-time@v2
id: current-time
@@ -32,15 +37,24 @@ jobs:
architecture: 'x64' # defaults to 'x64'
- name: install requirements
run: sudo apt-get install ca-certificates-java expect
- name: run build everything
run: bazel build //...
- name: Coursier cache
uses: coursier/cache-action@v6
- name: Build and Test
run: make test
- name: Cleanup before cache
shell: bash
run: |
rm -rf "$HOME/.ivy2/local" || true
find $HOME/Library/Caches/Coursier/v1 -name "ivydata-*.properties" -delete || true
find $HOME/.ivy2/cache -name "ivydata-*.properties" -delete || true
find $HOME/.cache/coursier/v1 -name "ivydata-*.properties" -delete || true
find $HOME/.sbt -name "*.lock" -delete || true
# ------------------------------------------
# ------------------------------------------
# Test client-test-data
client-test-data-tests:
name: Test client-test-data
needs: compile
name: Test client-test-data
runs-on: ubuntu-latest
steps:
- name: checkout source
@@ -64,114 +78,25 @@ jobs:
java-version: '11' # The OpenJDK version to make available on the path
architecture: 'x64' # defaults to 'x64'
- name: install requirements
run: sudo apt-get install ca-certificates-java expect redis-tools unzip
run: sudo apt-get install ca-certificates-java expect unzip
- name: Coursier cache
uses: coursier/cache-action@v6
- name: generate api-client-test-data
run: make client-test-data
- name: Cleanup before cache
shell: bash
run: |
rm -rf "$HOME/.ivy2/local" || true
find $HOME/Library/Caches/Coursier/v1 -name "ivydata-*.properties" -delete || true
find $HOME/.ivy2/cache -name "ivydata-*.properties" -delete || true
find $HOME/.cache/coursier/v1 -name "ivydata-*.properties" -delete || true
find $HOME/.sbt -name "*.lock" -delete || true
# ------------------------------------------
# ------------------------------------------

api-unit-tests:
name: API Unit Tests
needs: compile
runs-on: ubuntu-latest
steps:
- name: checkout source
uses: actions/checkout@v1
with:
fetch-depth: 15
- name: get current time
uses: josStorer/get-current-time@v2
id: current-time
with:
format: YYYY-MM-DD
utcOffset: "+02:00"
- name: use daily bazel disk cache
uses: actions/cache@v2
with:
path: ~/.bazel_disk_cache
key: ${{ runner.OS }}-bazel_disk_cache-${{ steps.current-time.outputs.formattedTime }}
- name: setup java version
uses: joschi/setup-jdk@v2
with:
java-version: '11' # The OpenJDK version to make available on the path
architecture: 'x64' # defaults to 'x64'
- name: install requirements
run: sudo apt-get install ca-certificates-java expect
- name: use daily bazel disk cache
uses: actions/cache@v2
with:
path: ~/.bazel_disk_cache
key: ${{ runner.OS }}-bazel_disk_cache-${{ steps.date.outputs.date }} }}
- name: run API unit tests
run: make test-unit

api-e2e-tests:
name: API E2E Tests
needs: compile
runs-on: ubuntu-latest
steps:
- name: checkout source
uses: actions/checkout@v1
with:
fetch-depth: 15
- name: get current time
uses: josStorer/get-current-time@v2
id: current-time
with:
format: YYYY-MM-DD
utcOffset: "+02:00"
- name: use daily bazel disk cache
uses: actions/cache@v2
with:
path: ~/.bazel_disk_cache
key: ${{ runner.OS }}-bazel_disk_cache-${{ steps.current-time.outputs.formattedTime }}
- name: setup java version
uses: joschi/setup-jdk@v2
with:
java-version: '11' # The OpenJDK version to make available on the path
architecture: 'x64' # defaults to 'x64'
- name: install requirements
run: sudo apt-get install ca-certificates-java expect redis-tools unzip
- name: run API E2E tests
run: make test-e2e

api-integration-tests:
name: API Integration Tests
needs: compile
runs-on: ubuntu-latest
steps:
- name: checkout source
uses: actions/checkout@v1
with:
fetch-depth: 15
- name: get current time
uses: josStorer/get-current-time@v2
id: current-time
with:
format: YYYY-MM-DD
utcOffset: "+02:00"
- name: use daily bazel disk cache
uses: actions/cache@v2
with:
path: ~/.bazel_disk_cache
key: ${{ runner.OS }}-bazel_disk_cache-${{ steps.current-time.outputs.formattedTime }}
- name: setup java version
uses: joschi/setup-jdk@v2
with:
java-version: '11' # The OpenJDK version to make available on the path
architecture: 'x64' # defaults to 'x64'
- name: Install dependencies
run: |
sudo apt-get install ca-certificates-java expect
- name: run API integration tests
run: |
make test-docker
make test-it
upgrade-integration-tests:
name: Upgrade Integration Tests
needs: compile
runs-on: ubuntu-latest
steps:
- name: checkout source
@@ -202,7 +127,6 @@ jobs:

docs-build-test:
name: Build Docs Testrun
needs: compile
runs-on: ubuntu-latest
steps:
- name: checkout source
@@ -242,9 +166,7 @@ jobs:
publish:
name: Publish (on release only)
needs: [
api-unit-tests,
api-e2e-tests,
api-integration-tests,
compile,
client-test-data-tests,
upgrade-integration-tests,
docs-build-test
@@ -273,7 +195,7 @@ jobs:
java-version: '11' # The OpenJDK version to make available on the path
architecture: 'x64' # defaults to 'x64'
- name: install requirements
run: sudo apt-get install ca-certificates-java expect redis-tools unzip
run: sudo apt-get install ca-certificates-java expect unzip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
@@ -1,37 +1,22 @@
/.project
.ijwb
.vscode
.bloop
.bsp
**/.idea
**/*.iml
**/*.ipr
**/*.iws
/logs/
/bin/
/info.aduna.logging.dir_IS_UNDEFINED/
.cache
.classpath
.docker
.ensime
.ensime_cache
.env
/.tmp/
native
**/.DS_Store
site/
docs/env
docs/_build
docs/_format_docu
docs/_format_docu_v2
docs/project
salsah1/project
webapi/project
webapi/_fuseki/run
webapi-it
webapi-test
upgrade/project
upgrade/target
triplestores/graphdb-se-7
idea.vmoptions
sipi/test
bazel-*

@@ -50,18 +35,14 @@ bazel-*
*.bak
.sbtrc

**/venv
**/__pycache__
dump.rdb
/site/
dependencies.txt
/client-test-data.zip
/db_prod_dump.trig
/db_staging_dump.trig
/db_test_dump.trig
/.vscode
/cleandeps.sh
/.metals
/sipi/images/082E/*
/sipi/images/originals/082E/*
/dependencies.bzl

.idea/
.metals/
metals.sbt

.tmp/
@@ -39,7 +39,6 @@ docs-clean: ## cleans the project directory

.PHONY: build
build: docker-build ## build all targets (excluding docs)
@bazel build //...

.PHOBY: check-for-outdated-deps
check-for-outdated-deps: ## check for outdated maven dependencies
@@ -55,7 +54,7 @@ buildifier: ## format Bazel WORKSPACE and BUILD.bazel files

.PHONY: docker-build-knora-api-image
docker-build-knora-api-image: # build and publish knora-api docker image locally
@bazel run //docker/knora-api:image
@sbt "webapi / Docker / publishLocal"

.PHONY: docker-publish-knora-api-image
docker-publish-knora-api-image: # publish knora-api image to Dockerhub
@@ -201,38 +200,15 @@ stack-db-only: env-file docker-build-knora-jena-fuseki-image ## starts only fus
test-docker: docker-build ## runs Docker image tests
bazel test //docker/...

.PHONY: test-webapi
test-webapi: docker-build ## runs all dsp-api tests.
bazel test //webapi/...

.PHONY: test-unit
test-unit: docker-build ## runs the dsp-api unit tests.
bazel test \
//webapi/src/test/scala/org/knora/webapi/http/... \
//webapi/src/test/scala/org/knora/webapi/messages/... \
//webapi/src/test/scala/org/knora/webapi/other/... \
//webapi/src/test/scala/org/knora/webapi/responders/... \
//webapi/src/test/scala/org/knora/webapi/routing/... \
//webapi/src/test/scala/org/knora/webapi/store/... \
//webapi/src/test/scala/org/knora/webapi/util/... \

.PHONY: test-e2e
test-e2e: docker-build ## runs the dsp-api e2e tests.
bazel test //webapi/src/test/scala/org/knora/webapi/e2e/...

.PHONY: client-test-data
client-test-data: docker-build ## runs the dsp-api e2e tests and generates client test data.
docker-compose -f docker-compose.yml up -d redis
$(CURRENT_DIR)/webapi/scripts/clear-client-test-data.sh
bazel test --cache_test_results=no //webapi/src/test/scala/org/knora/webapi/e2e/... --action_env=KNORA_WEBAPI_COLLECT_CLIENT_TEST_DATA=true
$(CURRENT_DIR)/webapi/scripts/dump-client-test-data.sh

.PHONY: test-it
test-it: docker-build ## runs the dsp-api integration tests.
bazel test //webapi/src/test/scala/org/knora/webapi/it/...
client-test-data: export KNORA_WEBAPI_COLLECT_CLIENT_TEST_DATA := true
client-test-data: build ## runs the dsp-api e2e tests and generates client test data.
$(CURRENT_DIR)/webapi/scripts/zap-client-test-data.sh
sbt -v "webapi/testOnly *E2ESpec *R2RSpec"
$(CURRENT_DIR)/webapi/scripts/zip-client-test-data.sh

.PHONY: test-repository-upgrade
test-repository-upgrade: init-db-test-minimal ## runs DB upgrade integration test
test-repository-upgrade: build init-db-test-minimal ## runs DB upgrade integration test
@rm -rf $(CURRENT_DIR)/.tmp/knora-test-data/v7.0.0/
@mkdir -p $(CURRENT_DIR)/.tmp/knora-test-data/v7.0.0/
@unzip $(CURRENT_DIR)/test_data/v7.0.0/v7.0.0-knora-test.trig.zip -d $(CURRENT_DIR)/.tmp/knora-test-data/v7.0.0/
@@ -245,8 +221,8 @@ test-repository-upgrade: init-db-test-minimal ## runs DB upgrade integration tes
@$(MAKE) -f $(THIS_FILE) stack-up

.PHONY: test
test: docker-build ## runs all test targets.
bazel test //webapi/...
test: build ## runs all tests
sbt -v +test

#################################
## Database Management
@@ -53,6 +53,7 @@ Each developer machine should have the following prerequisites installed:
* Docker Desktop: https://www.docker.com/products/docker-desktop
* Homebrew (on macOS): https://brew.sh
* [OpenJDK](https://adoptopenjdk.net) 11
* [sbt](https://www.scala-sbt.org/)
* [Bazel](https://bazel.build)

#### Java Adoptopenjdk 11

0 comments on commit 38faa9e

Please sign in to comment.