From 6043c2c80a132b46f7165669574a8a28c337dfb9 Mon Sep 17 00:00:00 2001 From: Fergus MacConnell Date: Thu, 8 Aug 2024 10:29:29 -0700 Subject: [PATCH] chore: Uncomment backend build job (#30) --- .DS_Store | Bin 10244 -> 10244 bytes .github/workflows/pr-open.yml | 32 ++-- backend/.dockerignore | 24 +++ {gwells/database => database}/README.md | 0 .../registries/data-load-migrate.sql | 0 .../codetables/wellsubmission/README.md | 0 .../wellsubmission/data-load-static-codes.sql | 0 ...ion.xform_gwells_surface_seal_material.csv | 0 .../aquifers/initialize-xforms-aquifers.sql | 0 .../scripts/aquifers/xforms-aquifers.csv | 0 .../scripts/local_dev/setup.sql | 0 .../initialize-xforms-registries.sql | 0 .../populate-registries-from-xform.sql | 0 .../registries/populate-xforms-registries.sql | 0 .../scripts/registries/post-deploy.sql | 0 .../user-defined-reports/report_export.xml | 0 .../wells_data_analysis.xml | 0 .../sql-developer/wells_data_analysis.xml | 0 .../sql-developer/xform-legacy-data.sql | 0 .../scripts/wellsearch/post-deploy.sql | 0 docker-compose.yml | 14 +- .../api-tests/files/square-shapefile.zip | Bin 1081 -> 0 bytes .../backend-command-script.sh | 0 .../copy-keycloak-roles.py | 0 .../download-aquifer-pdfs.py | 0 {gwells/scripts => scripts}/gwells-app.sh | 0 {gwells/scripts => scripts}/gwells-deploy.sh | 0 {gwells/scripts => scripts}/pre-deploy.sh | 0 .../profanitysearch/README.md | 0 .../profanitysearch/profanity.py | 0 .../profanitysearch/requirements.txt | 0 {gwells/scripts => scripts}/qaqc/README.md | 0 .../scripts => scripts}/qaqc/extract_data.py | 0 .../qaqc/get_esa_worldcover_bc.sh | 0 .../qaqc/gwells_locationqa.py | 0 .../scripts => scripts}/qaqc/requirements.txt | 0 .../scripts => scripts}/run-in-container.sh | 0 .../update-drinking-water-wtn.py | 0 {gwells/tests => tests}/api-tests/.envrc | 0 {gwells/tests => tests}/api-tests/README.md | 0 .../api-tests/aquifers_api_tests.json | 0 .../api-tests/aquifers_v2_api_tests.json | 0 .../api-tests/cities_api_tests.json | 0 .../api-tests/configuration_api_tests.json | 0 .../api-tests/exports_api_tests.json | 0 .../api-tests/local_aquifers.sh | 0 .../api-tests/local_configurations.sh | 0 .../api-tests/local_exports_utilities.sh | 0 .../api-tests/local_registries.sh | 0 .../api-tests/local_run_all.sh | 0 .../api-tests/local_submissions.sh | 0 .../tests => tests}/api-tests/local_wells.sh | 0 .../api-tests/local_wells_search.sh | 0 .../api-tests/registries_api_tests.json | 0 .../api-tests/registries_v2_api_tests.json | 0 .../api-tests/submissions_api_tests.json | 0 .../api-tests/submissions_v2_api_tests.json | 0 .../api-tests/utilities_api_tests.json | 0 .../api-tests/wells_api_tests.json | 0 .../api-tests/wells_search_api_tests.json | 0 .../api-tests/wells_search_v2_api_tests.json | 0 .../api-tests/wells_v2_api_tests.json | 0 tests/integration/package-lock.json | 140 ------------------ tests/integration/package.json | 15 -- tests/integration/src/main.js | 94 ------------ .../src/test_suites/it.backend.fastapi.json | 62 -------- .../src/test_suites/it.backend.fiber.json | 68 --------- .../src/test_suites/it.backend.nest.json | 62 -------- .../src/test_suites/it.backend.quarkus.json | 62 -------- tests/load/README.md | 8 - tests/load/backend-test.js | 34 ----- tests/load/frontend-test.js | 30 ---- {gwells/tests => tests}/zap/README.md | 0 {gwells/tests => tests}/zap/runzap.sh | 0 74 files changed, 47 insertions(+), 598 deletions(-) create mode 100644 backend/.dockerignore rename {gwells/database => database}/README.md (100%) rename {gwells/database => database}/codetables/registries/data-load-migrate.sql (100%) rename {gwells/database => database}/codetables/wellsubmission/README.md (100%) rename {gwells/database => database}/codetables/wellsubmission/data-load-static-codes.sql (100%) rename {gwells/database => database}/codetables/wellsubmission/pending-decision.xform_gwells_surface_seal_material.csv (100%) rename {gwells/database => database}/scripts/aquifers/initialize-xforms-aquifers.sql (100%) rename {gwells/database => database}/scripts/aquifers/xforms-aquifers.csv (100%) rename {gwells/database => database}/scripts/local_dev/setup.sql (100%) rename {gwells/database => database}/scripts/registries/initialize-xforms-registries.sql (100%) rename {gwells/database => database}/scripts/registries/populate-registries-from-xform.sql (100%) rename {gwells/database => database}/scripts/registries/populate-xforms-registries.sql (100%) rename {gwells/database => database}/scripts/registries/post-deploy.sql (100%) rename {gwells/database => database}/scripts/sql-developer/user-defined-reports/report_export.xml (100%) rename {gwells/database => database}/scripts/sql-developer/user-defined-reports/wells_data_analysis.xml (100%) rename {gwells/database => database}/scripts/sql-developer/wells_data_analysis.xml (100%) rename {gwells/database => database}/scripts/sql-developer/xform-legacy-data.sql (100%) rename {gwells/database => database}/scripts/wellsearch/post-deploy.sql (100%) delete mode 100755 gwells/tests/api-tests/files/square-shapefile.zip rename {gwells/scripts => scripts}/backend-command-script.sh (100%) rename {gwells/scripts => scripts}/copy-keycloak-roles.py (100%) rename {gwells/scripts => scripts}/download-aquifer-pdfs.py (100%) rename {gwells/scripts => scripts}/gwells-app.sh (100%) rename {gwells/scripts => scripts}/gwells-deploy.sh (100%) rename {gwells/scripts => scripts}/pre-deploy.sh (100%) rename {gwells/scripts => scripts}/profanitysearch/README.md (100%) rename {gwells/scripts => scripts}/profanitysearch/profanity.py (100%) rename {gwells/scripts => scripts}/profanitysearch/requirements.txt (100%) rename {gwells/scripts => scripts}/qaqc/README.md (100%) rename {gwells/scripts => scripts}/qaqc/extract_data.py (100%) rename {gwells/scripts => scripts}/qaqc/get_esa_worldcover_bc.sh (100%) rename {gwells/scripts => scripts}/qaqc/gwells_locationqa.py (100%) rename {gwells/scripts => scripts}/qaqc/requirements.txt (100%) rename {gwells/scripts => scripts}/run-in-container.sh (100%) rename {gwells/scripts => scripts}/update-drinking-water-wtn.py (100%) rename {gwells/tests => tests}/api-tests/.envrc (100%) rename {gwells/tests => tests}/api-tests/README.md (100%) rename {gwells/tests => tests}/api-tests/aquifers_api_tests.json (100%) rename {gwells/tests => tests}/api-tests/aquifers_v2_api_tests.json (100%) rename {gwells/tests => tests}/api-tests/cities_api_tests.json (100%) rename {gwells/tests => tests}/api-tests/configuration_api_tests.json (100%) rename {gwells/tests => tests}/api-tests/exports_api_tests.json (100%) rename {gwells/tests => tests}/api-tests/local_aquifers.sh (100%) rename {gwells/tests => tests}/api-tests/local_configurations.sh (100%) rename {gwells/tests => tests}/api-tests/local_exports_utilities.sh (100%) rename {gwells/tests => tests}/api-tests/local_registries.sh (100%) rename {gwells/tests => tests}/api-tests/local_run_all.sh (100%) rename {gwells/tests => tests}/api-tests/local_submissions.sh (100%) rename {gwells/tests => tests}/api-tests/local_wells.sh (100%) rename {gwells/tests => tests}/api-tests/local_wells_search.sh (100%) rename {gwells/tests => tests}/api-tests/registries_api_tests.json (100%) rename {gwells/tests => tests}/api-tests/registries_v2_api_tests.json (100%) rename {gwells/tests => tests}/api-tests/submissions_api_tests.json (100%) rename {gwells/tests => tests}/api-tests/submissions_v2_api_tests.json (100%) rename {gwells/tests => tests}/api-tests/utilities_api_tests.json (100%) rename {gwells/tests => tests}/api-tests/wells_api_tests.json (100%) rename {gwells/tests => tests}/api-tests/wells_search_api_tests.json (100%) rename {gwells/tests => tests}/api-tests/wells_search_v2_api_tests.json (100%) rename {gwells/tests => tests}/api-tests/wells_v2_api_tests.json (100%) delete mode 100644 tests/integration/package-lock.json delete mode 100644 tests/integration/package.json delete mode 100644 tests/integration/src/main.js delete mode 100644 tests/integration/src/test_suites/it.backend.fastapi.json delete mode 100644 tests/integration/src/test_suites/it.backend.fiber.json delete mode 100644 tests/integration/src/test_suites/it.backend.nest.json delete mode 100644 tests/integration/src/test_suites/it.backend.quarkus.json delete mode 100644 tests/load/README.md delete mode 100644 tests/load/backend-test.js delete mode 100644 tests/load/frontend-test.js rename {gwells/tests => tests}/zap/README.md (100%) rename {gwells/tests => tests}/zap/runzap.sh (100%) diff --git a/.DS_Store b/.DS_Store index bb353de98f25834de134dd1606da60033293316d..24594602d9cdb38327d66fdc824cb1012315de45 100644 GIT binary patch delta 75 zcmZn(XbG6$&nUbxU^hRb@MInVeNi@sWQGieM1~@U5{BZG;^ds9{QR8F<^s}8j0~HD Zg}B){V1gS9JJ>d}EBs>F{6d7882})K79;=w delta 71 zcmZn(XbG6$&nUDpU^hRb&}1F~{mmf);!KQ;n{$M?*`+*l@{^Nt@{<@C7z7v?7=Hrk WdH=y+V_`qrW_E>NESsf7nVA9plNTib diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index 4d88ba336..79cf6743b 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -9,22 +9,22 @@ concurrency: cancel-in-progress: true jobs: - # # https://github.com/bcgov-nr/action-builder-ghcr - # builds: - # name: Builds - # runs-on: ubuntu-22.04 - # strategy: - # matrix: - # package: [backend, frontend, migrations] - # timeout-minutes: 10 - # steps: - # - uses: bcgov-nr/action-builder-ghcr@v2.0.2 - # with: - # keep_versions: 50 - # package: ${{ matrix.package }} - # tag: ${{ github.event.number }} - # tag_fallback: latest - # triggers: ('${{ matrix.package }}/') + # https://github.com/bcgov-nr/action-builder-ghcr + builds: + name: Builds + runs-on: ubuntu-22.04 + strategy: + matrix: + package: [backend] + timeout-minutes: 10 + steps: + - uses: bcgov-nr/action-builder-ghcr@v2.0.2 + with: + keep_versions: 50 + package: ${{ matrix.package }} + tag: ${{ github.event.number }} + tag_fallback: latest + triggers: ('${{ matrix.package }}/') # # https://github.com/bcgov/quickstart-openshift-helpers # deploys: diff --git a/backend/.dockerignore b/backend/.dockerignore new file mode 100644 index 000000000..40b989b1f --- /dev/null +++ b/backend/.dockerignore @@ -0,0 +1,24 @@ +# Standard exclusions +*.md +.git +.github +.idea +.vscode +Dockerfile +CODE_OF_CONDUCT* +CONTRIBUTING* +LICENSE* +SECURITY* + +# Node exclusions +dist +node_modules +npm-debug.log + +# App-specific exclusions +# coverage +# e2e +# migrations +# output +# test +# tests \ No newline at end of file diff --git a/gwells/database/README.md b/database/README.md similarity index 100% rename from gwells/database/README.md rename to database/README.md diff --git a/gwells/database/codetables/registries/data-load-migrate.sql b/database/codetables/registries/data-load-migrate.sql similarity index 100% rename from gwells/database/codetables/registries/data-load-migrate.sql rename to database/codetables/registries/data-load-migrate.sql diff --git a/gwells/database/codetables/wellsubmission/README.md b/database/codetables/wellsubmission/README.md similarity index 100% rename from gwells/database/codetables/wellsubmission/README.md rename to database/codetables/wellsubmission/README.md diff --git a/gwells/database/codetables/wellsubmission/data-load-static-codes.sql b/database/codetables/wellsubmission/data-load-static-codes.sql similarity index 100% rename from gwells/database/codetables/wellsubmission/data-load-static-codes.sql rename to database/codetables/wellsubmission/data-load-static-codes.sql diff --git a/gwells/database/codetables/wellsubmission/pending-decision.xform_gwells_surface_seal_material.csv b/database/codetables/wellsubmission/pending-decision.xform_gwells_surface_seal_material.csv similarity index 100% rename from gwells/database/codetables/wellsubmission/pending-decision.xform_gwells_surface_seal_material.csv rename to database/codetables/wellsubmission/pending-decision.xform_gwells_surface_seal_material.csv diff --git a/gwells/database/scripts/aquifers/initialize-xforms-aquifers.sql b/database/scripts/aquifers/initialize-xforms-aquifers.sql similarity index 100% rename from gwells/database/scripts/aquifers/initialize-xforms-aquifers.sql rename to database/scripts/aquifers/initialize-xforms-aquifers.sql diff --git a/gwells/database/scripts/aquifers/xforms-aquifers.csv b/database/scripts/aquifers/xforms-aquifers.csv similarity index 100% rename from gwells/database/scripts/aquifers/xforms-aquifers.csv rename to database/scripts/aquifers/xforms-aquifers.csv diff --git a/gwells/database/scripts/local_dev/setup.sql b/database/scripts/local_dev/setup.sql similarity index 100% rename from gwells/database/scripts/local_dev/setup.sql rename to database/scripts/local_dev/setup.sql diff --git a/gwells/database/scripts/registries/initialize-xforms-registries.sql b/database/scripts/registries/initialize-xforms-registries.sql similarity index 100% rename from gwells/database/scripts/registries/initialize-xforms-registries.sql rename to database/scripts/registries/initialize-xforms-registries.sql diff --git a/gwells/database/scripts/registries/populate-registries-from-xform.sql b/database/scripts/registries/populate-registries-from-xform.sql similarity index 100% rename from gwells/database/scripts/registries/populate-registries-from-xform.sql rename to database/scripts/registries/populate-registries-from-xform.sql diff --git a/gwells/database/scripts/registries/populate-xforms-registries.sql b/database/scripts/registries/populate-xforms-registries.sql similarity index 100% rename from gwells/database/scripts/registries/populate-xforms-registries.sql rename to database/scripts/registries/populate-xforms-registries.sql diff --git a/gwells/database/scripts/registries/post-deploy.sql b/database/scripts/registries/post-deploy.sql similarity index 100% rename from gwells/database/scripts/registries/post-deploy.sql rename to database/scripts/registries/post-deploy.sql diff --git a/gwells/database/scripts/sql-developer/user-defined-reports/report_export.xml b/database/scripts/sql-developer/user-defined-reports/report_export.xml similarity index 100% rename from gwells/database/scripts/sql-developer/user-defined-reports/report_export.xml rename to database/scripts/sql-developer/user-defined-reports/report_export.xml diff --git a/gwells/database/scripts/sql-developer/user-defined-reports/wells_data_analysis.xml b/database/scripts/sql-developer/user-defined-reports/wells_data_analysis.xml similarity index 100% rename from gwells/database/scripts/sql-developer/user-defined-reports/wells_data_analysis.xml rename to database/scripts/sql-developer/user-defined-reports/wells_data_analysis.xml diff --git a/gwells/database/scripts/sql-developer/wells_data_analysis.xml b/database/scripts/sql-developer/wells_data_analysis.xml similarity index 100% rename from gwells/database/scripts/sql-developer/wells_data_analysis.xml rename to database/scripts/sql-developer/wells_data_analysis.xml diff --git a/gwells/database/scripts/sql-developer/xform-legacy-data.sql b/database/scripts/sql-developer/xform-legacy-data.sql similarity index 100% rename from gwells/database/scripts/sql-developer/xform-legacy-data.sql rename to database/scripts/sql-developer/xform-legacy-data.sql diff --git a/gwells/database/scripts/wellsearch/post-deploy.sql b/database/scripts/wellsearch/post-deploy.sql similarity index 100% rename from gwells/database/scripts/wellsearch/post-deploy.sql rename to database/scripts/wellsearch/post-deploy.sql diff --git a/docker-compose.yml b/docker-compose.yml index 324b316f6..7a6a864e8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -76,7 +76,7 @@ services: volumes: - pgdata-volume:/pgdata:z - type: bind - source: ./app/database/scripts/local_dev/setup.sql + source: ./database/scripts/local_dev/setup.sql target: /pgconf/setup.sql consistency: cached healthcheck: @@ -141,8 +141,8 @@ services: backend: platform: linux/x86_64 build: - context: ./openshift/docker/backend - dockerfile: Dockerfile.dev + context: ./backend + dockerfile: Dockerfile hostname: backend env_file: - path: ./.env.test @@ -197,12 +197,12 @@ services: command: ./scripts/backend-command-script.sh volumes: - type: bind - source: ./app/backend - target: /app/backend + source: ./backend + target: /backend consistency: cached - type: bind - source: ./app/scripts/backend-command-script.sh - target: /app/scripts/backend-command-script.sh + source: ./scripts/backend-command-script.sh + target: /scripts/backend-command-script.sh consistency: cached ports: - "8000:8000" diff --git a/gwells/tests/api-tests/files/square-shapefile.zip b/gwells/tests/api-tests/files/square-shapefile.zip deleted file mode 100755 index e4c782fe313f336b42c86b8e30125f4ec817a695..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1081 zcmWIWW@h1H0D;rd9RXkllwb$aIf<32MaB97D2jgXdU5X!P!fcNkQDj*M7sO?=@n-b zFfgb?%mm7!fwC9O3=FIg!2=~X;|_3(Rq}1M^l)GVidkKWJ7CuTxO26whXa~EY+R5Q z2V%?uDTJy6nS<3{JnjIiM{*a6e$=pGa@IMS1GEB!v4%|rp0F{aV%Qh~9pHfKw$gyW zNlHLr5XR!Rl%zD?3T6&aSSd1qNGw1K)x^gK1GD;p%0L*4i3LSj?ymms&cV@2Kq5Ze zJviRb(!xYZ$Hg%u)Hhnm1xYA4z{54j-_s>p38Bo)*xbU<*j&fR(n8P3)ZEC(*woB8 zHdZGf$kW#qsNcOPH8rn1GdV*^#~@ZG)Xy^nXl80UP!uSjXJBYX=wsv zn8wBicr!AIFyKz_5HAZreGX6ksG88zKU6i4QUzj|CPZ#Pw-h~%AoM!|gB?SE1-gFp rctq&Gi>V(NtLXaCV-2BSp9#Z$U>pW`v$BEIumYhe(1v$FRSXOOwe{DB diff --git a/gwells/scripts/backend-command-script.sh b/scripts/backend-command-script.sh similarity index 100% rename from gwells/scripts/backend-command-script.sh rename to scripts/backend-command-script.sh diff --git a/gwells/scripts/copy-keycloak-roles.py b/scripts/copy-keycloak-roles.py similarity index 100% rename from gwells/scripts/copy-keycloak-roles.py rename to scripts/copy-keycloak-roles.py diff --git a/gwells/scripts/download-aquifer-pdfs.py b/scripts/download-aquifer-pdfs.py similarity index 100% rename from gwells/scripts/download-aquifer-pdfs.py rename to scripts/download-aquifer-pdfs.py diff --git a/gwells/scripts/gwells-app.sh b/scripts/gwells-app.sh similarity index 100% rename from gwells/scripts/gwells-app.sh rename to scripts/gwells-app.sh diff --git a/gwells/scripts/gwells-deploy.sh b/scripts/gwells-deploy.sh similarity index 100% rename from gwells/scripts/gwells-deploy.sh rename to scripts/gwells-deploy.sh diff --git a/gwells/scripts/pre-deploy.sh b/scripts/pre-deploy.sh similarity index 100% rename from gwells/scripts/pre-deploy.sh rename to scripts/pre-deploy.sh diff --git a/gwells/scripts/profanitysearch/README.md b/scripts/profanitysearch/README.md similarity index 100% rename from gwells/scripts/profanitysearch/README.md rename to scripts/profanitysearch/README.md diff --git a/gwells/scripts/profanitysearch/profanity.py b/scripts/profanitysearch/profanity.py similarity index 100% rename from gwells/scripts/profanitysearch/profanity.py rename to scripts/profanitysearch/profanity.py diff --git a/gwells/scripts/profanitysearch/requirements.txt b/scripts/profanitysearch/requirements.txt similarity index 100% rename from gwells/scripts/profanitysearch/requirements.txt rename to scripts/profanitysearch/requirements.txt diff --git a/gwells/scripts/qaqc/README.md b/scripts/qaqc/README.md similarity index 100% rename from gwells/scripts/qaqc/README.md rename to scripts/qaqc/README.md diff --git a/gwells/scripts/qaqc/extract_data.py b/scripts/qaqc/extract_data.py similarity index 100% rename from gwells/scripts/qaqc/extract_data.py rename to scripts/qaqc/extract_data.py diff --git a/gwells/scripts/qaqc/get_esa_worldcover_bc.sh b/scripts/qaqc/get_esa_worldcover_bc.sh similarity index 100% rename from gwells/scripts/qaqc/get_esa_worldcover_bc.sh rename to scripts/qaqc/get_esa_worldcover_bc.sh diff --git a/gwells/scripts/qaqc/gwells_locationqa.py b/scripts/qaqc/gwells_locationqa.py similarity index 100% rename from gwells/scripts/qaqc/gwells_locationqa.py rename to scripts/qaqc/gwells_locationqa.py diff --git a/gwells/scripts/qaqc/requirements.txt b/scripts/qaqc/requirements.txt similarity index 100% rename from gwells/scripts/qaqc/requirements.txt rename to scripts/qaqc/requirements.txt diff --git a/gwells/scripts/run-in-container.sh b/scripts/run-in-container.sh similarity index 100% rename from gwells/scripts/run-in-container.sh rename to scripts/run-in-container.sh diff --git a/gwells/scripts/update-drinking-water-wtn.py b/scripts/update-drinking-water-wtn.py similarity index 100% rename from gwells/scripts/update-drinking-water-wtn.py rename to scripts/update-drinking-water-wtn.py diff --git a/gwells/tests/api-tests/.envrc b/tests/api-tests/.envrc similarity index 100% rename from gwells/tests/api-tests/.envrc rename to tests/api-tests/.envrc diff --git a/gwells/tests/api-tests/README.md b/tests/api-tests/README.md similarity index 100% rename from gwells/tests/api-tests/README.md rename to tests/api-tests/README.md diff --git a/gwells/tests/api-tests/aquifers_api_tests.json b/tests/api-tests/aquifers_api_tests.json similarity index 100% rename from gwells/tests/api-tests/aquifers_api_tests.json rename to tests/api-tests/aquifers_api_tests.json diff --git a/gwells/tests/api-tests/aquifers_v2_api_tests.json b/tests/api-tests/aquifers_v2_api_tests.json similarity index 100% rename from gwells/tests/api-tests/aquifers_v2_api_tests.json rename to tests/api-tests/aquifers_v2_api_tests.json diff --git a/gwells/tests/api-tests/cities_api_tests.json b/tests/api-tests/cities_api_tests.json similarity index 100% rename from gwells/tests/api-tests/cities_api_tests.json rename to tests/api-tests/cities_api_tests.json diff --git a/gwells/tests/api-tests/configuration_api_tests.json b/tests/api-tests/configuration_api_tests.json similarity index 100% rename from gwells/tests/api-tests/configuration_api_tests.json rename to tests/api-tests/configuration_api_tests.json diff --git a/gwells/tests/api-tests/exports_api_tests.json b/tests/api-tests/exports_api_tests.json similarity index 100% rename from gwells/tests/api-tests/exports_api_tests.json rename to tests/api-tests/exports_api_tests.json diff --git a/gwells/tests/api-tests/local_aquifers.sh b/tests/api-tests/local_aquifers.sh similarity index 100% rename from gwells/tests/api-tests/local_aquifers.sh rename to tests/api-tests/local_aquifers.sh diff --git a/gwells/tests/api-tests/local_configurations.sh b/tests/api-tests/local_configurations.sh similarity index 100% rename from gwells/tests/api-tests/local_configurations.sh rename to tests/api-tests/local_configurations.sh diff --git a/gwells/tests/api-tests/local_exports_utilities.sh b/tests/api-tests/local_exports_utilities.sh similarity index 100% rename from gwells/tests/api-tests/local_exports_utilities.sh rename to tests/api-tests/local_exports_utilities.sh diff --git a/gwells/tests/api-tests/local_registries.sh b/tests/api-tests/local_registries.sh similarity index 100% rename from gwells/tests/api-tests/local_registries.sh rename to tests/api-tests/local_registries.sh diff --git a/gwells/tests/api-tests/local_run_all.sh b/tests/api-tests/local_run_all.sh similarity index 100% rename from gwells/tests/api-tests/local_run_all.sh rename to tests/api-tests/local_run_all.sh diff --git a/gwells/tests/api-tests/local_submissions.sh b/tests/api-tests/local_submissions.sh similarity index 100% rename from gwells/tests/api-tests/local_submissions.sh rename to tests/api-tests/local_submissions.sh diff --git a/gwells/tests/api-tests/local_wells.sh b/tests/api-tests/local_wells.sh similarity index 100% rename from gwells/tests/api-tests/local_wells.sh rename to tests/api-tests/local_wells.sh diff --git a/gwells/tests/api-tests/local_wells_search.sh b/tests/api-tests/local_wells_search.sh similarity index 100% rename from gwells/tests/api-tests/local_wells_search.sh rename to tests/api-tests/local_wells_search.sh diff --git a/gwells/tests/api-tests/registries_api_tests.json b/tests/api-tests/registries_api_tests.json similarity index 100% rename from gwells/tests/api-tests/registries_api_tests.json rename to tests/api-tests/registries_api_tests.json diff --git a/gwells/tests/api-tests/registries_v2_api_tests.json b/tests/api-tests/registries_v2_api_tests.json similarity index 100% rename from gwells/tests/api-tests/registries_v2_api_tests.json rename to tests/api-tests/registries_v2_api_tests.json diff --git a/gwells/tests/api-tests/submissions_api_tests.json b/tests/api-tests/submissions_api_tests.json similarity index 100% rename from gwells/tests/api-tests/submissions_api_tests.json rename to tests/api-tests/submissions_api_tests.json diff --git a/gwells/tests/api-tests/submissions_v2_api_tests.json b/tests/api-tests/submissions_v2_api_tests.json similarity index 100% rename from gwells/tests/api-tests/submissions_v2_api_tests.json rename to tests/api-tests/submissions_v2_api_tests.json diff --git a/gwells/tests/api-tests/utilities_api_tests.json b/tests/api-tests/utilities_api_tests.json similarity index 100% rename from gwells/tests/api-tests/utilities_api_tests.json rename to tests/api-tests/utilities_api_tests.json diff --git a/gwells/tests/api-tests/wells_api_tests.json b/tests/api-tests/wells_api_tests.json similarity index 100% rename from gwells/tests/api-tests/wells_api_tests.json rename to tests/api-tests/wells_api_tests.json diff --git a/gwells/tests/api-tests/wells_search_api_tests.json b/tests/api-tests/wells_search_api_tests.json similarity index 100% rename from gwells/tests/api-tests/wells_search_api_tests.json rename to tests/api-tests/wells_search_api_tests.json diff --git a/gwells/tests/api-tests/wells_search_v2_api_tests.json b/tests/api-tests/wells_search_v2_api_tests.json similarity index 100% rename from gwells/tests/api-tests/wells_search_v2_api_tests.json rename to tests/api-tests/wells_search_v2_api_tests.json diff --git a/gwells/tests/api-tests/wells_v2_api_tests.json b/tests/api-tests/wells_v2_api_tests.json similarity index 100% rename from gwells/tests/api-tests/wells_v2_api_tests.json rename to tests/api-tests/wells_v2_api_tests.json diff --git a/tests/integration/package-lock.json b/tests/integration/package-lock.json deleted file mode 100644 index 4ff39047c..000000000 --- a/tests/integration/package-lock.json +++ /dev/null @@ -1,140 +0,0 @@ -{ - "name": "integration-tests", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "integration-tests", - "version": "1.0.0", - "dependencies": { - "axios": "^1.6.8", - "dotenv": "^16.3.1", - "js-yaml": "^4.1.0", - "lodash": "^4.17.21" - } - }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" - }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" - }, - "node_modules/axios": { - "version": "1.6.8", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz", - "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==", - "dependencies": { - "follow-redirects": "^1.15.6", - "form-data": "^4.0.0", - "proxy-from-env": "^1.1.0" - } - }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/dotenv": { - "version": "16.3.1", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", - "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/motdotla/dotenv?sponsor=1" - } - }, - "node_modules/follow-redirects": { - "version": "1.15.6", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", - "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], - "engines": { - "node": ">=4.0" - }, - "peerDependenciesMeta": { - "debug": { - "optional": true - } - } - }, - "node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/proxy-from-env": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" - } - } -} diff --git a/tests/integration/package.json b/tests/integration/package.json deleted file mode 100644 index 32cd584ef..000000000 --- a/tests/integration/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "integration-tests", - "version": "1.0.0", - "type": "module", - "main": "src/main.js", - "scripts": { - "dev": "node src/main.js" - }, - "dependencies": { - "axios": "^1.6.8", - "dotenv": "^16.3.1", - "js-yaml": "^4.1.0", - "lodash": "^4.17.21" - } -} diff --git a/tests/integration/src/main.js b/tests/integration/src/main.js deleted file mode 100644 index 498198e11..000000000 --- a/tests/integration/src/main.js +++ /dev/null @@ -1,94 +0,0 @@ -import dotenv from "dotenv"; -import axios from "axios"; -import * as fs from "fs"; -import * as path from "path"; -import { fileURLToPath } from "url"; -import assert from "node:assert/strict"; - -import pkg from "lodash"; - -dotenv.config(); - -const { isEqual, omit } = pkg; - -const __filename = fileURLToPath(import.meta.url); - -const __dirname = path.dirname(__filename); -const apiName = process.env.API_NAME; -const BASE_URL = process.env.BASE_URL; - -async function performEachMethod(BASE_URL, testCase, method, id) { - let url = BASE_URL + testCase.path; - if (id && (method === "GET" || method === "PUT" || method === "PATCH" || method === "DELETE")) { - if (url.endsWith("/") === false) { - url = url + "/" + id; - } else { - url = url + id; - } - } - let payload; - if (method === "POST") { - payload = testCase.data?.post_payload; - } else if (method === "PUT") { - payload = testCase.data?.put_payload; - } else if (method === "PATCH") { - payload = testCase.data?.patch_payload; - } - const response = await axios({ - method: method, - url: url, - headers: { - ...testCase.headers - }, - data: payload - }); - console.info(`Response for ${method} ${url} : ${response.status}`); - const methodAssertion = testCase.assertions.find(assertion => assertion.method === method); - const responseData = response.data?.data || response.data; - if (methodAssertion) { - if (methodAssertion.status_code) { - assert(response.status === methodAssertion.status_code); - } - if (methodAssertion.body) { - assert(isEqual(omit(responseData, testCase.data.id_field), methodAssertion.body) === true); - } - } - if (method === "POST") { - return responseData[testCase.data.id_field]; - } -} - -async function performTesting(testSuitesDir, testSuiteFile) { - console.info(`Running test suite for : ${testSuiteFile}`); - const testSuitePath = path.join(testSuitesDir, testSuiteFile); - const testSuite = JSON.parse(await fs.promises.readFile(testSuitePath, "utf-8")); - for (const testCase of testSuite.tests) { - let id = null; - for (const method of testCase.methods) { - const responseId = await performEachMethod(BASE_URL, testCase, method, id); - if (responseId) { - id = responseId; - } - } - } -} - -const main = async () => { - const testSuitesDir = path.join(__dirname, "test_suites"); - const testSuiteFiles = await fs.promises.readdir(testSuitesDir); - const testFile = testSuiteFiles.find(file => file.includes(apiName)); - await performTesting(testSuitesDir, testFile); -}; - -try { - await main(); -} catch (e) { - if (e instanceof assert.AssertionError) { - console.error(e); - process.exit(137); - } - console.error(e); - process.exit(137); -} - - diff --git a/tests/integration/src/test_suites/it.backend.fastapi.json b/tests/integration/src/test_suites/it.backend.fastapi.json deleted file mode 100644 index 0771844c6..000000000 --- a/tests/integration/src/test_suites/it.backend.fastapi.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "api_name": "fastapi", - "api_version": "1.0.0", - "base_url": "${BASE_URL}", - "tests": [ - { - "name": "User Endpoint TEST", - "methods": [ - "GET", - "POST", - "GET", - "DELETE" - ], - "path": "/api/v1/user/", - "headers": { - "Content-Type": "application/json", - "accept": "application/json" - }, - "data": { - "id_field": "user_id", - "post_payload": { - "name": "John", - "email": "John.ipsum@test.com" - }, - "put_payload": { - "name": "Jane", - "email": "Jane.ipsum@test.com" - }, - "patch_payload": { - "name": "Jane", - "email": "Jane.ipsum@test.com" - } - }, - "assertions": [ - { - "method": "POST", - "status_code": 200, - "body": { - "name": "John", - "email": "John.ipsum@test.com" - } - }, - { - "method": "GET", - "status_code": 200 - }, - { - "method": "PUT", - "status_code": 200, - "body": { - "name": "Jane", - "email": "Jane.ipsum@test.com" - } - }, - { - "method": "DELETE", - "status_code": 200 - } - ] - } - ] -} diff --git a/tests/integration/src/test_suites/it.backend.fiber.json b/tests/integration/src/test_suites/it.backend.fiber.json deleted file mode 100644 index fa7ba86b4..000000000 --- a/tests/integration/src/test_suites/it.backend.fiber.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "api_name": "fiber", - "api_version": "1.0.0", - "base_url": "${BASE_URL}", - "tests": [ - { - "name": "User Endpoint TEST", - "methods": [ - "GET", - "POST", - "PUT", - "GET", - "DELETE" - ], - "path": "/api/v1/users", - "headers": { - "Content-Type": "application/json" - }, - "data": { - "id_field": "id", - "post_payload": { - "name": "John", - "email": "John.ipsum@test.com", - "addresses": [ - ] - }, - "put_payload": { - "name": "Jane", - "email": "Jane.ipsum@test.com", - "addresses": [ - ] - }, - "patch_payload": { - "name": "Jane", - "email": "Jane.ipsum@test.com" - } - }, - "assertions": [ - { - "method": "POST", - "status_code": 201, - "body": { - "name": "John", - "email": "John.ipsum@test.com", - "addresses": null - } - }, - { - "method": "GET", - "status_code": 200 - }, - { - "method": "PUT", - "status_code": 200, - "body": { - "name": "Jane", - "email": "Jane.ipsum@test.com", - "addresses": null - } - }, - { - "method": "DELETE", - "status_code": 204 - } - ] - } - ] -} diff --git a/tests/integration/src/test_suites/it.backend.nest.json b/tests/integration/src/test_suites/it.backend.nest.json deleted file mode 100644 index da0d89c52..000000000 --- a/tests/integration/src/test_suites/it.backend.nest.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "api_name": "nest", - "api_version": "1.0.0", - "base_url": "${BASE_URL}", - "tests": [ - { - "name": "User Endpoint TEST", - "methods": [ - "GET", - "POST", - "PUT", - "GET", - "DELETE" - ], - "path": "/api/v1/users", - "headers": { - "Content-Type": "application/json" - }, - "data": { - "id_field": "id", - "post_payload": { - "name": "John", - "email": "John.ipsum@test.com" - }, - "put_payload": { - "name": "Jane", - "email": "Jane.ipsum@test.com" - }, - "patch_payload": { - "name": "Jane", - "email": "Jane.ipsum@test.com" - } - }, - "assertions": [ - { - "method": "POST", - "status_code": 201, - "body": { - "name": "John", - "email": "John.ipsum@test.com" - } - }, - { - "method": "GET", - "status_code": 200 - }, - { - "method": "PUT", - "status_code": 200, - "body": { - "name": "Jane", - "email": "Jane.ipsum@test.com" - } - }, - { - "method": "DELETE", - "status_code": 200 - } - ] - } - ] -} diff --git a/tests/integration/src/test_suites/it.backend.quarkus.json b/tests/integration/src/test_suites/it.backend.quarkus.json deleted file mode 100644 index a7c9b6b57..000000000 --- a/tests/integration/src/test_suites/it.backend.quarkus.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "api_name": "nest", - "api_version": "1.0.0", - "base_url": "${BASE_URL}", - "tests": [ - { - "name": "User Endpoint TEST", - "methods": [ - "GET", - "POST", - "PUT", - "GET", - "DELETE" - ], - "path": "/api/v1/users", - "headers": { - "Content-Type": "application/json" - }, - "data": { - "id_field": "id", - "post_payload": { - "name": "John", - "email": "John.ipsum@test.com" - }, - "put_payload": { - "name": "Jane", - "email": "Jane.ipsum@test.com" - }, - "patch_payload": { - "name": "Jane", - "email": "Jane.ipsum@test.com" - } - }, - "assertions": [ - { - "method": "POST", - "status_code": 201, - "body": { - "name": "John", - "email": "John.ipsum@test.com" - } - }, - { - "method": "GET", - "status_code": 200 - }, - { - "method": "PUT", - "status_code": 200, - "body": { - "name": "Jane", - "email": "Jane.ipsum@test.com" - } - }, - { - "method": "DELETE", - "status_code": 204 - } - ] - } - ] -} diff --git a/tests/load/README.md b/tests/load/README.md deleted file mode 100644 index d2fe3d4e2..000000000 --- a/tests/load/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# This Directory contains the load test scripts for the project. -## The scripts are written in JS and use the k6 framework. [k6](https://k6.io) - -1. The Tests are samples, dev teams are encouraged to write their own tests based on the use cases of their project. -2. The tests are run using GitHub Actions. - -# Please inform platform services team if you would do a HUGE load TEST on OpenShift platform as it impacts the platform performance. -``` diff --git a/tests/load/backend-test.js b/tests/load/backend-test.js deleted file mode 100644 index 31c11ca8b..000000000 --- a/tests/load/backend-test.js +++ /dev/null @@ -1,34 +0,0 @@ -import { check } from "k6"; -import * as http from "k6/http"; -import { Rate } from "k6/metrics"; - - -export let errorRate = new Rate("errors"); - - -function checkStatus(response, checkName, statusCode = 200) { - let success = check(response, { - [checkName]: (r) => { - if (r.status === statusCode) { - return true; - } else { - console.error(checkName + " failed. Incorrect response code." + r.status); - return false; - } - } - }); - errorRate.add(!success, { tag1: checkName }); -} - - -export default function(token) { - let url = `${__ENV.BACKEND_URL}/v1/users`; - let params = { - headers: { - "Content-Type": "application/json" - } - }; - let res = http.get(url, params); - checkStatus(res, "get-all-users", 200); - -} diff --git a/tests/load/frontend-test.js b/tests/load/frontend-test.js deleted file mode 100644 index ecd24a46f..000000000 --- a/tests/load/frontend-test.js +++ /dev/null @@ -1,30 +0,0 @@ -import { check } from "k6"; -import * as http from "k6/http"; -import { Rate } from "k6/metrics"; - - -export let errorRate = new Rate("errors"); - - -function checkStatus(response, checkName, statusCode = 200) { - let success = check(response, { - [checkName]: (r) => { - if (r.status === statusCode) { - return true; - } else { - console.error(checkName + " failed. Incorrect response code." + r.status); - return false; - } - } - }); - errorRate.add(!success, { tag1: checkName }); -} - - -export default function(token) { - let url = `${__ENV.FRONTEND_URL}`; - - let res = http.get(url); - checkStatus(res, "frontend", 200); - -} diff --git a/gwells/tests/zap/README.md b/tests/zap/README.md similarity index 100% rename from gwells/tests/zap/README.md rename to tests/zap/README.md diff --git a/gwells/tests/zap/runzap.sh b/tests/zap/runzap.sh similarity index 100% rename from gwells/tests/zap/runzap.sh rename to tests/zap/runzap.sh