-
Notifications
You must be signed in to change notification settings - Fork 0
177 lines (144 loc) · 6.51 KB
/
daily-test.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
name: daily run for taf
on:
schedule:
- cron: '0 5 * * 1-5'
# - cron: '0 5 * * 1'
workflow_dispatch:
inputs:
suite:
description: 'Test suite to run: "full" for full run, "smoke" for smoke tests'
required: true
default: 'full'
target:
description: 'Specify a target URL to test an already existing BI server'
required: false
default: ''
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
node-version: [22.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
runs-on: ${{ matrix.os }}
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
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@v4
- 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@v4
with:
repository: Breeding-Insight/bi-docker-stack
submodules: recursive
token: ${{ secrets.DOCKERPATH }}
path: bi-docker-stack
- 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-qa.yml up -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 60s
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, custom URL)
# if: matrix.os == 'ubuntu-latest' && (contains(github.event.schedule, '0 5 * * 1') || (github.event.inputs.suite=='full'))
if: (github.event.inputs.suite=='full' && github.event.inputs.target != '')
run: npm run test:chromeWeekly --url="${github.event.inputs.target}"
- name: Run tests on Chrome (full)
# if: matrix.os == 'ubuntu-latest' && (contains(github.event.schedule, '0 5 * * 1') || (github.event.inputs.suite=='full'))
if: github.event.inputs.suite=='full' || contains(github.event.schedule, '0 5 * * 1-5')
run: npm run test:chromeWeekly
- name: Run tests on Chrome (smoke tests, custom URL)
# if: matrix.os == 'ubuntu-latest' && (contains(github.event.schedule, '0 5 * * 2-5') || (github.event.inputs.suite=='smoke'))
if: (github.event.inputs.suite=='smoke' && github.event.inputs.target != '')
run: npm run test:chromeDaily --url="${github.event.inputs.target}"
- name: Run tests on Chrome (smoke tests)
# if: matrix.os == 'ubuntu-latest' && (contains(github.event.schedule, '0 5 * * 2-5') || (github.event.inputs.suite=='smoke'))
if: (github.event.inputs.suite=='smoke')
run: npm run test:chromeDaily
- name: Publish Report Artifact
uses: actions/upload-artifact@v4
if: always()
with:
name: cucumber-report-${{ matrix.os }}-${{ github.run_number }}
path: ${{ github.workspace }}/report/*
- name: Test end of run container status
run: |
docker logs brapi-server
docker logs biapi
docker logs biweb