You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

cix.sh 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #!/bin/bash
  2. # QA pipeline
  3. set -euo pipefail
  4. REPOX_ARGS="-Dorchestrator.artifactory.apiKey=$REPOX_API_KEY -Dorchestrator.artifactory.repositories=sonarsource-qa"
  5. TEST_ARGS="-Pcix=true -DbuildNumber=$CI_BUILD_NUMBER $REPOX_ARGS"
  6. case "$RUN_ACTIVITY" in
  7. run-db-unit-tests-*)
  8. DB_ENGINE=$(sed "s/run-db-unit-tests-//g" <<< $RUN_ACTIVITY)
  9. ./run-db-unit-tests.sh "http://infra.internal.sonarsource.com/jenkins/orch-${DB_ENGINE}.properties" \
  10. ${TEST_ARGS}
  11. ;;
  12. run-db-integration-tests-*)
  13. DB_ENGINE=$(sed "s/run-db-integration-tests-//g" <<< $RUN_ACTIVITY | cut -d \- -f 1)
  14. CATEGORY=$(sed "s/run-db-integration-tests-//g" <<< $RUN_ACTIVITY | cut -d \- -f 2)
  15. if [[ "$GITHUB_BRANCH" != "PULLREQUEST-"* ]] && [[ "$GITHUB_BRANCH" != "master" ]] && [[ "$GITHUB_BRANCH" != "branch-"* ]] && [[ "$GITHUB_BRANCH" != "dogfood-on-next" ]]; then
  16. # do not execute QA tests on feature branch outside pull request
  17. exit 0
  18. elif [[ "$GITHUB_BRANCH" == "PULLREQUEST-"* ]] && [[ "$DB_ENGINE" != "postgresql93" ]]; then
  19. # restrict QA tests to PostgreSQL on pull requests
  20. exit 0
  21. elif [[ "$GITHUB_BRANCH" == "dogfood-on-next" ]] && [[ "$DB_ENGINE" != "postgresql93" ]]; then
  22. # restrict QA tests to PostgreSQL on dogfood branch
  23. exit 0
  24. else
  25. ./gradlew --no-daemon --console plain -i \
  26. :tests:integrationTest \
  27. -Dcategory="$CATEGORY" \
  28. -Dorchestrator.configUrl="http://infra.internal.sonarsource.com/jenkins/orch-$DB_ENGINE.properties" \
  29. ${TEST_ARGS}
  30. fi
  31. ;;
  32. run-it-released-plugins)
  33. ./run-integration-tests.sh "Plugins" "http://infra.internal.sonarsource.com/jenkins/orch-h2.properties" \
  34. ${TEST_ARGS}
  35. ;;
  36. run-perf-tests)
  37. ./run-perf-tests.sh \
  38. ${TEST_ARGS}
  39. ;;
  40. run-upgrade-tests-*)
  41. DB_ENGINE=$(sed "s/run-upgrade-tests-//g" <<< $RUN_ACTIVITY)
  42. ./run-upgrade-tests.sh "http://infra.internal.sonarsource.com/jenkins/orch-${DB_ENGINE}.properties" \
  43. ${TEST_ARGS}
  44. ;;
  45. *)
  46. echo "unknown RUN_ACTIVITY = $RUN_ACTIVITY"
  47. exit 1
  48. ;;
  49. esac