Skip to content

Commit

Permalink
BUILD-3176 Use SonarSource CirrusCI infrastructure to run tests
Browse files Browse the repository at this point in the history
  • Loading branch information
drautureau-sonarsource committed Sep 28, 2023
1 parent 7a88eaf commit e272945
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
16 changes: 11 additions & 5 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,10 @@ env:


vm_instance_template: &VM_TEMPLATE
experimental: true # see https://github.com/cirruslabs/cirrus-ci-docs/issues/1051
image: docker-builder-v*
type: t2.small
region: eu-central-1
subnet_id: ${CIRRUS_AWS_SUBNET}
disk: 10
cpu: 4
memory: 16G


multi_arch_build_task:
Expand Down Expand Up @@ -112,12 +108,16 @@ public_scan_task:
- docker pull "${PUBLIC_IMAGE_NAME}:${tag}"
- java -jar wss-unified-agent.jar -c .cirrus/wss-unified-agent.config -apiKey $MEND_API_KEY -product ${WS_PRODUCTNAME} -project ${PUBLIC_IMAGE_NAME}:${tag} -wss.url ${WS_WSS_URL} -docker.scanImages true

multi_arch_test_docker_builder:
multi_arch_test_task:
matrix:
- env:
CIRRUS_ARCH: arm64
INSTANCE_TYPE: t4g.large
AMI_NAME: docker-builder-arm64-v*
- env:
CIRRUS_ARCH: amd64
INSTANCE_TYPE: t3.large
AMI_NAME: docker-builder-v*
env:
matrix:
- test_name: docker
Expand All @@ -136,10 +136,16 @@ multi_arch_test_docker_builder:
tag: $CURRENT_VERSION-enterprise
- test_name: docker-compose
tag: $CURRENT_VERSION-datacenter
ec2_instance:
<<: *VM_TEMPLATE
image: ${AMI_NAME}
type: ${INSTANCE_TYPE}
architecture: ${CIRRUS_ARCH}
login_script:
- docker login --username $DOCKER_USERNAME --password $DOCKER_PASSWORD
test_script:
- echo "Test the ${STAGING_IMAGE_NAME}:${tag} image supporting linux/${CIRRUS_ARCH}"
- sysctl -w vm.max_map_count=524288 # set the recommended memory for ES
- ulimit -n 131072 # set the recommended number of opened file descriptors for ES
- ./run-tests.sh "${STAGING_IMAGE_NAME}:${tag}" "${test_name}"
depends_on: multi_arch_build
4 changes: 2 additions & 2 deletions run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ sanity_check_image() {
cd $test_compose_path
export PORT=$port
export IMAGE=$1
docker-compose up -d sonarqube
docker compose up -d sonarqube
if wait_for_sonarqube_dce "$image"; then
info "$image-app: OK !"
result=ok
Expand All @@ -126,7 +126,7 @@ sanity_check_image() {
fi

info "$image-app: stopping container stack"
docker-compose stop
docker compose stop

[[ $result == ok ]]
fi
Expand Down

0 comments on commit e272945

Please sign in to comment.