-
Notifications
You must be signed in to change notification settings - Fork 129
155 lines (154 loc) · 6.25 KB
/
e2e_tests.yaml
File metadata and controls
155 lines (154 loc) · 6.25 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: Run E2E Cypress Tests
on:
workflow_dispatch:
pull_request:
types: [ready_for_review]
push:
branches:
- master
jobs:
E2E-Tests:
runs-on: k8s-diffgram-arc-runner-set
# Service containers to run with `container-job`
strategy:
matrix:
# run copies of the current job in parallel
containers: [1,2,3,4,5,6, 7]
container:
image: diffgram/cypress-e2e:latest
options: --user root --shm-size 4gb
env:
NODE_ENV: development
DATABASE_URL: postgresql+psycopg2://postgres:postgres@postgres/diffgram_unit_tests?sslmode=disable
PYTHONPATH: /__w/diffgram
DIFFGRAM_SYSTEM_MODE: testing_e2e
GOOGLE_APPLICATION_CREDENTIALS: /gcp/gcloud-service-key.json
DIFFGRAM_STATIC_STORAGE_PROVIDER: minio
IS_DIFFGRAM_S3_V4_SIGNATURE: True
DIFFGRAM_S3_BUCKET_NAME: foo
DIFFGRAM_MINIO_ACCESS_KEY_ID: root
DIFFGRAM_MINIO_ACCESS_KEY_SECRET: actionskeye2etests
ML__DIFFGRAM_S3_BUCKET_NAME: foo
DIFFGRAM_MINIO_ENDPOINT_URL: http://minio:9000
ML__DIFFGRAM_AZURE_CONTAINER_NAME: testsgithubactions
CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
SERVICE_ACCOUNT_FULL_PATH: /gcp/gcloud-service-key.json
DIFFGRAM_HOST_OS: ${{ secrets.DIFFGRAM_HOST_OS }}
DIFFGRAM_VERSION_TAG: Testing
DIFFGRAM_INSTALL_FINGERPRINT: ${{ secrets.DIFFGRAM_INSTALL_FINGERPRINT }}
USER: root
RUNNER_ALLOW_RUNASROOT: true
RUNNER_TOOL_CACHE: /opt/hostedtoolcache
AGENT_TOOLSDIRECTORY: /opt/hostedtoolcache
RABBITMQ_HOST: rabbitmq
RABBITMQ_PORT: 5672
RABBITMQ_DEFAULT_USER: diffgram
RABBITMQ_DEFAULT_PASS: diffgram
DEBUG: cypress:* cypress run
DOCKER_CONTEXT: true
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
# Provide the password for postgres
env:
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
rabbitmq:
image: rabbitmq:3.10-rc-management-alpine
env:
RABBITMQ_DEFAULT_USER: diffgram
RABBITMQ_DEFAULT_PASS: diffgram
ports:
- 5672
minio:
image: minio/minio:edge-cicd
ports:
- 9000:9000
env:
MINIO_ACCESS_KEY: minioadmin
MINIO_SECRET_KEY: minioadmin
volumes:
- /__w/diffgram/diffgram/myminio/.minio/data:/export
- /__w/diffgram/diffgram/myminio/.minio/data:/root/.minio
options: --health-cmd "curl -s http://localhost:9000/minio/health/live"
steps:
- uses: actions/setup-node@v4
with:
node-version: 18
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- run: cp -rf . /__w/diffgram
- run: cd /__w/diffgram
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- name: Fetch mc client
run: curl -o ./mc -# https://dl.min.io/client/mc/release/linux-amd64/mc && chmod +x ./mc
- name: Create the dev bucket
run: ./mc alias set minio http://minio:9000 minioadmin minioadmin && ./mc mb minio/testbucket
- name: Set policy
run: ./mc policy set policy minio/testbucket
- run: cd walrus
- run: gdal-config --version
- run: pip3 install -r walrus/requirements.txt
- run: pip3 install -r default/requirements.txt
- run: pip3 install pytest sqlalchemy-utils
- run: mkdir /gcp
- run: echo ${{ secrets.GOOGLE_SERVICE_ACCOUNT_ENCODED }} | base64 --decode --ignore-garbage > /gcp/gcloud-service-key.json
- name: Check processes
run: ls -a
- run: yarn --cwd frontend/ install
- run: NODE_OPTIONS=--openssl-legacy-provider yarn --cwd frontend/ build
# Populate DB
- run: cd default/play_and_scripts/scripts; python3 setup_database_e2e_tests.py
- name: "UI Tests - Chrome"
uses: cypress-io/github-action@v4.0.0
with:
# we have already installed all dependencies above
install: false
start: |
NODE_OPTIONS=--openssl-legacy-provider
yarn --cwd run dev
python3 ../default/main.py
python3 ../walrus/main.py
python3 ../local_dispatcher/local_dispatch.py
wait-on: "http://localhost:8081, http://localhost:8082, http://localhost:8085"
wait-on-timeout: 40
browser: chrome
record: true
parallel: true
group: "UI - Chrome"
config-file: ./cypress.config.ts
working-directory: frontend
env:
# Recommended: pass the GitHub token lets this action correctly
# determine the unique run id necessary to re-run the checks
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_ENV: development
DEBUG: 'cypress:server:util:process_profiler'
DATABASE_URL: postgresql+psycopg2://postgres:postgres@postgres/diffgram_unit_tests?sslmode=disable
PYTHONPATH: /__w/diffgram
DIFFGRAM_SYSTEM_MODE: testing_e2e
GOOGLE_APPLICATION_CREDENTIALS: /gcp/gcloud-service-key.json
DIFFGRAM_STATIC_STORAGE_PROVIDER: minio
DIFFGRAM_S3_BUCKET_NAME: testbucket
ML__DIFFGRAM_S3_BUCKET_NAME: testbucket
IS_DIFFGRAM_S3_V4_SIGNATURE: True
DIFFGRAM_MINIO_ACCESS_KEY_ID: minioadmin
DIFFGRAM_MINIO_ACCESS_KEY_SECRET: minioadmin
DIFFGRAM_MINIO_ENDPOINT_URL: http://minio:9000
CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
SERVICE_ACCOUNT_FULL_PATH: /gcp/gcloud-service-key.json
DIFFGRAM_HOST_OS: ${{ secrets.DIFFGRAM_HOST_OS }}
DIFFGRAM_VERSION_TAG: 0.0.1
DIFFGRAM_INSTALL_FINGERPRINT: ${{ secrets.DIFFGRAM_INSTALL_FINGERPRINT }}