Skip to content
Snippets Groups Projects
Commit a6575938 authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

lcs128: simplified testing stages. Just use one stage running all...

lcs128: simplified testing stages. Just use one stage running all unit/integration/regression tests. The overall runtime is smaller, and each test is executed only once.
parent 9f616a3a
No related branches found
No related tags found
No related merge requests found
...@@ -2,8 +2,7 @@ stages: ...@@ -2,8 +2,7 @@ stages:
- prepare-base - prepare-base
- prepare - prepare
- build - build
- unit_test - test
- integration_test
- regression_test - regression_test
- dockerize - dockerize
- deploy-prod - deploy-prod
...@@ -337,67 +336,6 @@ build_lofar_tbbwriter_control: ...@@ -337,67 +336,6 @@ build_lofar_tbbwriter_control:
- build_lofar_base - build_lofar_base
when: manual # this takes a long time to build and the image is humongous. So let's not do that on every commit. when: manual # this takes a long time to build and the image is humongous. So let's not do that on every commit.
#
# UNIT TEST STAGE
#
unit_test_SCU:
stage: unit_test
image: ${REGISTRY_PATH}/ci_scu:$CI_COMMIT_SHORT_SHA
rules:
- if: '$CI_COMMIT_BRANCH !~ /Front-End-Only/'
script:
- PACKAGE=SCU
- echo "Testing $PACKAGE..."
- cd build/gnucxx11_opt
- SKIP_PYTHON_COVERAGE=true SKIP_INTEGRATION_TESTS=true SKIP_REGRESSION_TESTS=true ctest
interruptible: true
services:
- rabbitmq:latest
variables:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
LOFAR_DEFAULT_BROKER: 'rabbitmq' # override default 'localhost' which does not work for CI service rabbitmq.
needs:
- build_SCU
artifacts:
name: unit-test-report
when: always
paths:
- build/gnucxx11_opt/Testing/Temporary/LastTest.log
integration_test_TMSS_Frontend:
stage: integration_test
image: ${REGISTRY_PATH}/ci_tmss:$CI_COMMIT_SHORT_SHA
allow_failure: true
script:
- PACKAGE=TMSSFrontend
- echo "Testing $PACKAGE..."
- cd build/gnucxx11_opt/SAS/TMSS/frontend/tmss_webapp
- echo 'copying schemas ...'
- npm run prepareTemplateSchemas
- nohup npm start &
- sleep 30
- cd build
- npm run test:ci
- npx kill-port 3000
- npm run cleanTemplateSchemas
needs:
- build_TMSS
coverage: /All files[^|]*\|[^|]*\s+([\d\.]+)/
artifacts:
name: front-end-junit-report
when: always
expire_in: never
paths:
- build/gnucxx11_opt/SAS/TMSS/frontend/tmss_webapp/coverage/
reports:
junit:
- build/gnucxx11_opt/SAS/TMSS/frontend/tmss_webapp/junit.xml
coverage_report:
coverage_format: cobertura
path: build/gnucxx11_opt/SAS/TMSS/frontend/tmss_webapp/coverage/cobertura-coverage.xml
# #
# DOCKERIZE # DOCKERIZE
# #
...@@ -419,11 +357,11 @@ dockerize_TMSS: ...@@ -419,11 +357,11 @@ dockerize_TMSS:
artifacts: true artifacts: true
# #
# INTEGRATION TEST STAGE # TEST STAGE
# #
integration_test_SCU: test_SCU:
stage: integration_test stage: test
image: ${REGISTRY_PATH}/ci_scu:$CI_COMMIT_SHORT_SHA image: ${REGISTRY_PATH}/ci_scu:$CI_COMMIT_SHORT_SHA
services: services:
- rabbitmq:latest - rabbitmq:latest
...@@ -437,19 +375,18 @@ integration_test_SCU: ...@@ -437,19 +375,18 @@ integration_test_SCU:
- PACKAGE=SCU - PACKAGE=SCU
- echo "Integration Testing $PACKAGE..." - echo "Integration Testing $PACKAGE..."
- cd build/gnucxx11_opt - cd build/gnucxx11_opt
- SKIP_PYTHON_COVERAGE=true SKIP_INTEGRATION_TESTS=false SKIP_UNIT_TESTS=true SKIP_REGRESSION_TESTS=true ctest - SKIP_PYTHON_COVERAGE=true ctest
interruptible: true interruptible: true
needs: needs:
- build_SCU - build_SCU
# - unit_test_SCU
artifacts: artifacts:
name: integration-test-report name: test-report
when: always when: always
paths: paths:
- build/gnucxx11_opt/Testing/Temporary/LastTest.log - build/gnucxx11_opt/Testing/Temporary/LastTest.log
integration_test_LTAIngest: test_LTAIngest:
stage: integration_test stage: test
image: ${REGISTRY_PATH}/ci_lta:$CI_COMMIT_SHORT_SHA image: ${REGISTRY_PATH}/ci_lta:$CI_COMMIT_SHORT_SHA
rules: rules:
- if: '$CI_COMMIT_BRANCH !~ /Front-End-Only/' - if: '$CI_COMMIT_BRANCH !~ /Front-End-Only/'
...@@ -457,7 +394,7 @@ integration_test_LTAIngest: ...@@ -457,7 +394,7 @@ integration_test_LTAIngest:
- PACKAGE=LTAIngest - PACKAGE=LTAIngest
- echo "Integration Testing $PACKAGE..." - echo "Integration Testing $PACKAGE..."
- cd build/gnucxx11_opt - cd build/gnucxx11_opt
- SKIP_PYTHON_COVERAGE=true SKIP_INTEGRATION_TESTS=false SKIP_UNIT_TESTS=false SKIP_REGRESSION_TESTS=true ctest - SKIP_PYTHON_COVERAGE=true ctest
interruptible: true interruptible: true
services: services:
- rabbitmq:latest - rabbitmq:latest
...@@ -468,15 +405,13 @@ integration_test_LTAIngest: ...@@ -468,15 +405,13 @@ integration_test_LTAIngest:
needs: needs:
- build_LTAIngest - build_LTAIngest
artifacts: artifacts:
name: integration-test-report name: test-report
when: always when: always
paths: paths:
- build/gnucxx11_opt/Testing/Temporary/LastTest.log - build/gnucxx11_opt/Testing/Temporary/LastTest.log
unit_and_integration_and_regression_test_TMSS: test_TMSS:
# for speed reasons, we just run all TMSS related unit/integration&regression tests in one job stage: test
# Skip item based upon only match
stage: integration_test
image: ${REGISTRY_PATH}/ci_tmss:$CI_COMMIT_SHORT_SHA image: ${REGISTRY_PATH}/ci_tmss:$CI_COMMIT_SHORT_SHA
services: services:
- rabbitmq:latest - rabbitmq:latest
...@@ -492,7 +427,7 @@ unit_and_integration_and_regression_test_TMSS: ...@@ -492,7 +427,7 @@ unit_and_integration_and_regression_test_TMSS:
- PACKAGE=TMSS - PACKAGE=TMSS
- echo "Unit & Integration Testing $PACKAGE..." - echo "Unit & Integration Testing $PACKAGE..."
- cd build/gnucxx11_opt - cd build/gnucxx11_opt
- SKIP_PYTHON_COVERAGE=true SKIP_INTEGRATION_TESTS=false SKIP_UNIT_TESTS=false SKIP_REGRESSION_TESTS=false ctest --output-on-failure - SKIP_PYTHON_COVERAGE=true ctest --output-on-failure
interruptible: true interruptible: true
allow_failure: false allow_failure: false
rules: rules:
...@@ -500,13 +435,45 @@ unit_and_integration_and_regression_test_TMSS: ...@@ -500,13 +435,45 @@ unit_and_integration_and_regression_test_TMSS:
needs: needs:
- build_TMSS - build_TMSS
artifacts: artifacts:
name: integration-test-report name: test-report
when: always when: always
paths: paths:
- build/gnucxx11_opt/Testing/Temporary/LastTest.log - build/gnucxx11_opt/Testing/Temporary/LastTest.log
test_TMSS_Frontend:
stage: test
image: ${REGISTRY_PATH}/ci_tmss:$CI_COMMIT_SHORT_SHA
allow_failure: true
script:
- PACKAGE=TMSSFrontend
- echo "Testing $PACKAGE..."
- cd build/gnucxx11_opt/SAS/TMSS/frontend/tmss_webapp
- echo 'copying schemas ...'
- npm run prepareTemplateSchemas
- nohup npm start &
- sleep 30
- cd build
- npm run test:ci
- npx kill-port 3000
- npm run cleanTemplateSchemas
needs:
- build_TMSS
coverage: /All files[^|]*\|[^|]*\s+([\d\.]+)/
artifacts:
name: front-end-junit-report
when: always
expire_in: never
paths:
- build/gnucxx11_opt/SAS/TMSS/frontend/tmss_webapp/coverage/
reports:
junit:
- build/gnucxx11_opt/SAS/TMSS/frontend/tmss_webapp/junit.xml
coverage_report:
coverage_format: cobertura
path: build/gnucxx11_opt/SAS/TMSS/frontend/tmss_webapp/coverage/cobertura-coverage.xml
multi_project_integration_test_TMSS_COBALT_STATION: multi_project_integration_test_TMSS_COBALT_STATION:
stage: integration_test stage: test
allow_failure: true allow_failure: true
rules: rules:
- if: '$CI_COMMIT_BRANCH !~ /Front-End-Only/' - if: '$CI_COMMIT_BRANCH !~ /Front-End-Only/'
...@@ -518,36 +485,6 @@ multi_project_integration_test_TMSS_COBALT_STATION: ...@@ -518,36 +485,6 @@ multi_project_integration_test_TMSS_COBALT_STATION:
project: lofar2.0/multi-project-integration project: lofar2.0/multi-project-integration
strategy: depend strategy: depend
#
# REGRESSION TEST STAGE
#
regression_test_SCU:
stage: regression_test
image: ${REGISTRY_PATH}/ci_scu:$CI_COMMIT_SHORT_SHA
rules:
- if: '$CI_COMMIT_BRANCH !~ /Front-End-Only/'
services:
- rabbitmq:latest
variables:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
LOFAR_DEFAULT_BROKER: 'rabbitmq' # override default 'localhost' which does not work for CI service rabbitmq.
script:
- PACKAGE=SCU
- echo "Regression Testing $PACKAGE..."
- cd build/gnucxx11_opt
- SKIP_PYTHON_COVERAGE=true SKIP_REGRESSION_TESTS=false SKIP_UNIT_TESTS=true SKIP_INTEGRATION_TESTS=true ctest
interruptible: true
needs:
- build_SCU
# - unit_test_SCU
artifacts:
name: regression-test-report
when: always
paths:
- build/gnucxx11_opt/Testing/Temporary/LastTest.log
# #
# deploy-prod stage # deploy-prod stage
# #
...@@ -626,7 +563,7 @@ deploy-tmss-prod-lcs129: ...@@ -626,7 +563,7 @@ deploy-tmss-prod-lcs129:
- rm -rf lobster/.env; rm -rf lobster/env; rm -rf tmss/.env; rm -rf tmss/env; rm -rf app/.env; rm -rf app/id_rsa - rm -rf lobster/.env; rm -rf lobster/env; rm -rf tmss/.env; rm -rf tmss/env; rm -rf app/.env; rm -rf app/id_rsa
- ssh $LOFAR_USER@$LOFAR_TARGET -p ${LOFAR_TARGET_PORT} "cd .lofar/tmss/tmss; ln -s ..env ; ${COMPOSE_PATH} down; ${COMPOSE_PATH} build; ${COMPOSE_PATH} up -d" - ssh $LOFAR_USER@$LOFAR_TARGET -p ${LOFAR_TARGET_PORT} "cd .lofar/tmss/tmss; ln -s ..env ; ${COMPOSE_PATH} down; ${COMPOSE_PATH} build; ${COMPOSE_PATH} up -d"
deploy-tmss-prod-cs001: deploy-lobster-prod-cs001:
extends: .deploy-tmss-prod extends: .deploy-tmss-prod
variables: variables:
LOFAR_ENVIRONMENT: ${TMSS_DEPLOY_CS001_PRODUCTION} LOFAR_ENVIRONMENT: ${TMSS_DEPLOY_CS001_PRODUCTION}
...@@ -780,7 +717,7 @@ deploy-SCU-prod: ...@@ -780,7 +717,7 @@ deploy-SCU-prod:
environment: environment:
name: production name: production
needs: needs:
- job: integration_test_SCU - job: test_SCU
artifacts: false artifacts: false
allow_failure: true allow_failure: true
when: manual when: manual
...@@ -803,7 +740,7 @@ deploy-LTAIngest-prod: ...@@ -803,7 +740,7 @@ deploy-LTAIngest-prod:
environment: environment:
name: production name: production
needs: needs:
- job: integration_test_LTAIngest - job: test_LTAIngest
artifacts: false artifacts: false
allow_failure: true allow_failure: true
when: manual when: manual
...@@ -831,7 +768,7 @@ sonarcloud_check_TMSS_Frontend: ...@@ -831,7 +768,7 @@ sonarcloud_check_TMSS_Frontend:
extends: .sonarcloud_check extends: .sonarcloud_check
allow_failure: true # for main branch, after all issues have been resolved, disable this allow_failure: true # for main branch, after all issues have been resolved, disable this
needs: needs:
- integration_test_TMSS_Frontend - test_TMSS_Frontend
script: script:
#Run with the location of the sonar-project.properties for that specific project. The basic properties file is generated by sonarcloud when setting up your project #Run with the location of the sonar-project.properties for that specific project. The basic properties file is generated by sonarcloud when setting up your project
- echo 'Checking contents of tms_webapp..' - echo 'Checking contents of tms_webapp..'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment