From 5f251c44e10dd513b40b39836062b0cd961696e7 Mon Sep 17 00:00:00 2001 From: Kat Date: Fri, 6 Sep 2024 10:16:43 +0100 Subject: [PATCH] Run test outside of the task --- .github/workflows/review_pipeline.yml | 28 +++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/workflows/review_pipeline.yml b/.github/workflows/review_pipeline.yml index 944396c36..27b3c356b 100644 --- a/.github/workflows/review_pipeline.yml +++ b/.github/workflows/review_pipeline.yml @@ -71,18 +71,22 @@ jobs: email: performance_testing_user@example.com password: password run: | - network=$(aws ecs describe-services --cluster $cluster --services $service --query services[0].networkConfiguration) - overrides='{ "containerOverrides" : [{ "name" : "app", "command" : ["bundle", "exec", "rake", "performance:run_ab[$email,$password]"]}]}' - arn=$(aws ecs run-task --cluster $cluster --task-definition $ad_hoc_task_definition --network-configuration "$network" --overrides "$overrides" --group migrations --launch-type FARGATE --query tasks[0].taskArn) - echo "Waiting for performance test task to complete" - temp=${arn##*/} - id=${temp%*\"} - aws ecs wait tasks-stopped --cluster $cluster --tasks $id - succeeded=$(aws ecs describe-tasks --cluster $cluster --tasks $id --query "tasks[0].stopCode == 'EssentialContainerExited' && to_string(tasks[0].containers[0].exitCode) == '0'") - if [ $succeeded == true ]; then exit 0; else exit 1; fi - env: - PERFORMANCE_TESTING_USER_EMAIL: coordinator1@example.com - PERFORMANCE_TESTING_USER_PASSWORD: password + echo install apache2-utils + sudo apt-get update && sudo apt-get install -y apache2-utils + echo get token + TOKEN=$(curl -c token_cookies.txt -s https://review.submit-social-housing-data.levellingup.gov.uk/2621/account/sign-in | grep '