-
Notifications
You must be signed in to change notification settings - Fork 0
/
orb.yml
75 lines (69 loc) · 2.71 KB
/
orb.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
version: 2.1
description: The end-to-end test suite for use in CLA app pipelines
namespace: cla-end-to-end-tests
orbs:
aws-cli: circleci/[email protected]
aws-ecr: circleci/[email protected] # this orb doesn't support OIDC v2, so we use aws-cli to authenticate
commands:
behave:
description: Run the CLA apps in a docker cluster and run the Behave test suite against them
steps:
- run: |
export E2E_WORKING_DIRECTORY=/tmp/cla-end-to-end-tests
echo "export E2E_WORKING_DIRECTORY=$E2E_WORKING_DIRECTORY" >> $BASH_ENV
mkdir -p $E2E_WORKING_DIRECTORY
echo "E2E_WORKING_DIRECTORY is $E2E_WORKING_DIRECTORY"
echo "E2E_BRANCH is $E2E_BRANCH"
git clone --single-branch --branch ${E2E_BRANCH:-main} [email protected]:ministryofjustice/cla-end-to-end-tests.git $E2E_WORKING_DIRECTORY
# Pull cla_public image
- aws-cli/setup:
role_arn: $CLA_PUBLIC_ECR_ROLE_TO_ASSUME
region: ECR_REGION
- run: |
cd $E2E_WORKING_DIRECTORY
./.circleci/pull_images clapublic
# Pull cla_backend image
- aws-cli/setup:
role_arn: $CLA_BACKEND_ECR_ROLE_TO_ASSUME
region: ECR_REGION
- run: |
cd $E2E_WORKING_DIRECTORY
./.circleci/pull_images clabackend
# Pull cla_frontend image
- aws-cli/setup:
role_arn: $CLA_FRONTEND_ECR_ROLE_TO_ASSUME
region: ECR_REGION
- run: |
cd $E2E_WORKING_DIRECTORY
./.circleci/pull_images clafrontend
# Pull socket_server image
- aws-cli/setup:
role_arn: $SOCKET_SERVER_ECR_ROLE_TO_ASSUME
region: ECR_REGION
- run: |
cd $E2E_WORKING_DIRECTORY
./.circleci/pull_images clasocketserver
- run:
name: Check services are up
command: |
cd $E2E_WORKING_DIRECTORY/behave
docker-compose build
docker-compose run start_applications
docker-compose exec clabackend bin/create_db.sh
- run:
name: Run behave tests
command: |
cd $E2E_WORKING_DIRECTORY/behave
docker-compose run --name cla-end-to-end cla-end-to-end
- run:
name: Copy artifacts
command: |
cd $E2E_WORKING_DIRECTORY/behave
echo "Manually copying files because circleci docker executor does not support volumes"
echo "https://support.circleci.com/hc/en-us/articles/360007324514-How-can-I-mount-volumes-to-docker-containers-"
mkdir -p /tmp/end-to-end-data
docker cp cla-end-to-end:/data /tmp/end-to-end-data
when: always
- store_artifacts:
path: /tmp/end-to-end-data
destination: data