-
Notifications
You must be signed in to change notification settings - Fork 0
194 lines (160 loc) · 6.66 KB
/
test-branch.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
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
name: Custom run of TAF
on:
workflow_dispatch:
inputs:
suite:
description: 'Test suite to run: "full" for full run, "smoke" for smoke tests'
required: true
default: 'full'
biapi:
description: 'Branch of bi-api to use'
required: true
default: 'develop'
biweb:
description: 'Branch of bi-web to use'
required: true
default: 'develop'
bi_docker_stack:
description: 'Branch of bi-docker-stack to use'
required: true
default: 'develop'
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
node-version: [16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
runs-on: ${{ matrix.os }}
name: "Testing bi-web: ${{ github.event.inputs.biweb }}, bi-api: ${{ github.event.inputs.biapi }}, bi-docker-stack: ${{ github.event.inputs.bi_docker_stack }}"
env:
USER_ID: 1001
GROUP_ID: 1001
OAUTH_CLIENT_ID: APP-ZX6M8LSAN3YIIAQ5
OAUTH_CLIENT_SECRET: ${{ secrets.OAUTH_CLIENT_SECRET }}
JWT_SECRET: ${{ secrets.JWT_SECRET }}
JWT_DOMAIN: localhost
OAUTH_AUTH_URL: https://sandbox.orcid.org/oauth/authorize
OAUTH_TOKEN_URL: https://sandbox.orcid.org/oauth/token
OAUTH_OPENID_ISSUER: https://sandbox.orcid.org
OAUTH_OPENID_JWKSURI: https://sandbox.orcid.org/oauth/jwks
OAUTH_OPENID_USERINFOURL: https://sandbox.orcid.org/oauth/userinfo
GITHUB_ACTOR: rob-ouser-bi
GITHUB_TOKEN: ${{ secrets.ROB_OUSER_TOKEN }}
DB_PASSWORD: postgres
DB_SERVER: dbserver:5432
DB_NAME: bidb
DB_USER: postgres
ADMIN_ORCID: 0000-0003-0437-8310
API_INTERNAL_PORT: 8081
API_INTERNAL_TEST_PORT: 8082
BRAPI_SERVER_PORT: 8080
BRAPI_DEFAULT_URL: http://brapiserver:8080
BRAPI_REFERENCE_SOURCE: breeding-insight.net
BRAPI_DB_SERVER: dbserver:5432
BRAPI_DB: postgres
BRAPI_DB_USER: postgres
BRAPI_DB_PASSWORD: postgres
WEB_BASE_URL: http://localhost
API_BASE_URL: http://localhost
REGISTERED_DOMAIN: localhost
EMAIL_RELAY_HOST: mailhog
EMAIL_RELAY_PORT: 1025
EMAIL_FROM: bidevteam@cornell.edu
GIGWA_HOST: http://localhost:5080/
GIGWA_USER: gigwadmin
GIGWA_PASSWORD: nimda
GIGWA_MONGO_USER: mongo
GIGWA_MONGO_PASSWORD: mongo
AWS_REGION: us-east-1
AWS_ACCESS_KEY_ID: test
AWS_SECRET_KEY: test
AWS_S3_ENDPOINT: http://localhost:4566
AWS_GENO_BUCKET: breedinginsight.org-test
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
#check out docker
- name: Docker checkout (private)
uses: actions/checkout@v2
with:
repository: Breeding-Insight/bi-docker-stack
ref: ${{ github.event.inputs.bi_docker_stack }}
submodules: recursive
token: ${{ secrets.DOCKERPATH }}
path: bi-docker-stack
- name: Update bi-api Branch
uses: actions/checkout@v2
with:
repository: Breeding-Insight/bi-api
ref: ${{ github.event.inputs.biapi }}
path: bi-docker-stack/bi-api
- name: Update bi-web Branch
uses: actions/checkout@v2
with:
repository: Breeding-Insight/bi-web
ref: ${{ github.event.inputs.biweb }}
path: bi-docker-stack/bi-web
- run: npm install
- name: Set up debug for github actions
run: npm install --save-prod @actions/github @actions/core
- name: Set up JDK 13
uses: actions/setup-java@v1.4.3
with:
java-version: 13
#from bi-docker-stack
- run: docker-compose -f bi-docker-stack/docker-compose.yml -f bi-docker-stack/docker-compose-redis.yml -f bi-docker-stack/docker-compose-gigwa.yml -f bi-docker-stack/docker-compose-ci.yml up --build -d
- name: Set up Chrome
uses: browser-actions/setup-chrome@latest
with:
chrome-version: 122
if: matrix.os == 'ubuntu-latest'
- name: Run Chrome
if: matrix.os == 'ubuntu-latest'
run: chrome --version
- name: Sleep to ensure docker set up
run: sleep 180s
shell: bash
- name: Set up required bidb data for tests
run: |
docker cp populate-taf-data.sql bidb:/populate-taf-data.sql
docker exec bidb psql -U postgres -a -f populate-taf-data.sql -d bidb
- name: Set up brapi data
run: |
trailMixId=$( docker exec bidb psql -U postgres -d bidb -t -c "SELECT id FROM program WHERE name='Trail Mix'" )
snacksId=$( docker exec bidb psql -U postgres -d bidb -t -c "SELECT id FROM program WHERE name='Snacks'" )
snacksId="$(echo -e "${snacksId}" | sed -e 's/^[[:space:]]*//')"
trailMixId="$(echo -e "${trailMixId}" | sed -e 's/^[[:space:]]*//')"
docker ps -a
docker logs brapi-server
docker logs biapi
docker logs biweb
docker inspect --format "{{json .State.Health }}" brapi-server | jq
docker exec brapi-server curl --header "Content-Type: application/json;charset=UTF-8" -v -d '[{"programName":"Snacks","externalReferences":[{"referenceSource":"breeding-insight.net","referenceID":"'"$snacksId"'"}]}]' http://localhost:8080/brapi/v2/programs
docker exec brapi-server curl --header "Content-Type: application/json;charset=UTF-8" -v -d '[{"programName":"Trail Mix","externalReferences":[{"referenceSource":"breeding-insight.net","referenceID":"'"$trailMixId"'"}]}]' http://localhost:8080/brapi/v2/programs
- name: Run tests on Chrome (full)
if: github.event.inputs.suite=='full'
run: npm run test:chromeWeekly
- name: Run tests on Chrome (smoke tests)
if: (github.event.inputs.suite=='smoke')
run: npm run test:chromeDaily
- id: biWebBranch
run: INPUT=${{ github.event.inputs.biweb }} && echo "::set-output name=branch::${INPUT/\//-}"
- id: biAPIBranch
run: INPUT=${{ github.event.inputs.biapi }} && echo "::set-output name=branch::${INPUT/\//-}"
- name: Publish Report Artifact
uses: actions/upload-artifact@v2
if: always()
with:
name: cucumber-report-web-${{ steps.biWebBranch.outputs.branch }}-api-${{ steps.biAPIBranch.outputs.branch }}-${{ github.run_number }}
path: ${{ github.workspace }}/report/*
- name: Test end of run container status
if: always()
run: |
docker logs brapi-server
docker logs biapi
docker logs biweb