-
Notifications
You must be signed in to change notification settings - Fork 6
187 lines (183 loc) · 7.09 KB
/
e2e.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
name: Chaise end-to-end tests
on:
push:
branches:
- 'master'
pull_request:
branches:
- 'master'
concurrency: chaise_env
jobs:
install-and-test:
runs-on: ubuntu-20.04
env:
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
SAUCE_TUNNEL_IDENTIFIER: ${{github.run_id}}
SHARDING: true
HEADLESS: false
PYTHONWARNINGS: ignore:Unverified HTTPS request
timeout-minutes: 120
steps:
- name: Checkout repository code
uses: actions/checkout@v2
with:
path: chaise
- name: Setup the system
run: |
echo "node version:"
node --version
echo "npm version:"
npm --version
echo "env variables:"
printenv
sudo timedatectl set-timezone America/Los_Angeles
export TZ=America/Los_Angeles
export PATH="$(systemd-path user-binaries):$PATH"
sudo apt-get -y update
sudo apt-get -y install libcurl4-openssl-dev libjson-c-dev
sudo service postgresql stop || true
sudo service postgresql start 12
sudo apt-get install apache2 apache2-dev ssl-cert libapache2-mod-wsgi-py3
sudo ln -s /etc/apache2/conf-enabled /etc/apache2/conf.d
sudo a2enmod ssl
sudo a2ensite default-ssl
sudo groupadd -o -g $(id -g www-data) apache
sudo apt-get install -y python3-setuptools python3-ply
sudo python3 --version
sudo pip3 --version
sudo su -c 'echo /usr/lib/python3.8/site-packages > /usr/local/lib/python3.8/dist-packages/sys-site-packages.pth'
sudo su -c 'python3 -c "import site;print(site.PREFIXES);"'
sudo su -c 'python3 -c "import site;print(site.getsitepackages())"'
: # the line below will make sure pyopenssl and cryptography have compatible versions
sudo pip3 install -U pyopenssl cryptography
sudo pip3 install flask
sudo pip3 install requests
sudo pip3 install globus_sdk
sudo pip3 install psycopg2-binary
sudo pip3 install oauth2client
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Install webauthn
run: |
sudo useradd -m -r webauthn
sudo su -c '/usr/bin/python3 -c "import sys;import pprint;pprint.pprint(sys.path)"' - webauthn
git clone https://github.com/informatics-isi-edu/webauthn.git
cd webauthn
sudo make testvars
sudo make install
sudo make deploy
sudo bash ./test/ubuntu-travis-setup.sh
sudo a2enmod webauthn
sudo service apache2 restart
- name: Install hatrac
run: |
git clone https://github.com/informatics-isi-edu/hatrac.git
cd hatrac
sudo python3 ./setup.py install
sudo useradd -m -r hatrac
sudo -H -u postgres createuser -d hatrac
sudo -H -u postgres psql -c "GRANT webauthn TO hatrac"
sudo -H -u hatrac createdb hatrac
sudo cp test/hatrac_config.json ~hatrac/
sudo -H -u hatrac hatrac-deploy admin
sudo su -c 'python3 -c "import hatrac as m;m.sample_httpd_config()"' - hatrac > ../wsgi_hatrac.conf
sudo cp ../wsgi_hatrac.conf /etc/apache2/conf.d/wsgi_hatrac.conf
sudo mkdir /var/www/hatrac
sudo chown hatrac /var/www/hatrac
- name: Install ermrest
run: |
git clone https://github.com/informatics-isi-edu/ermrest.git
cd ermrest
sudo -H make install PLATFORM=ubuntu1604
sudo which ermrest-deploy
sudo -H make deploy PLATFORM=ubuntu1604
cd ../chaise
sudo cp test/ermrest_config.json /home/ermrest/
sudo chmod a+r /home/ermrest/ermrest_config.json
- name: Install ermrestjs
run: |
git clone https://github.com/informatics-isi-edu/ermrestjs.git
cd ermrestjs
make dist
sudo make deploy
- name: Install chaise
run: |
sudo mkdir -p /var/www/html/chaise
cd chaise
make deps-test
make dist-wo-deps
sudo make deploy
- name: Add tests users
run: |
sudo -H -u webauthn webauthn2-manage adduser test1
sudo -H -u webauthn webauthn2-manage passwd test1 dummypassword
sudo -H -u webauthn webauthn2-manage addattr admin
sudo -H -u webauthn webauthn2-manage assign test1 admin
sudo -H -u webauthn webauthn2-manage adduser test2
sudo -H -u webauthn webauthn2-manage passwd test2 dummypassword
- name: Restart apache
run: |
sudo service apache2 restart
- name: Setup and connect to saucelabs
timeout-minutes: 2
run: |
curl https://saucelabs.com/downloads/sc-4.6.2-linux.tar.gz -o saucelabs.tar.gz
tar -xzf saucelabs.tar.gz
cd sc-*
bin/sc -u ${{secrets.SAUCE_USERNAME}} -k ${{secrets.SAUCE_ACCESS_KEY}} -i ${{github.run_id}} -f /tmp/sc_ready --no-ssl-bump-domains=127.0.0.1,localhost --pidfile=/tmp/sc_client.pid &
- name: Check sauce connect
run: |
while [ ! -f /tmp/sc_ready ]; do
echo "Waiting for Sauce Connect..."
sleep 5;
done;
- name: Run full features confirmation test spec
id: test-full-features-confirmation
continue-on-error: true
run: |
cd chaise
make testfullfeaturesconfirmation
- name: Run default config test spec
id: test-default-config
continue-on-error: true
run: |
cd chaise
make testdefaultconfig
- name: Run full features test spec
id: test-full-features
continue-on-error: true
run: |
cd chaise
make testfullfeatures
- name: Run delete prohibited test spec
id: test-delete-prohibited
continue-on-error: true
run: |
cd chaise
make testdeleteprohibited
- name: Check on full features confirmation test spec
if: always() && steps.test-full-features-confirmation.outcome != 'success'
run: exit 1
- name: Check on default config test spec
if: always() && steps.test-default-config.outcome != 'success'
run: exit 1
- name: Check on full features test spec
if: always() && steps.test-full-features.outcome != 'success'
run: exit 1
- name: Check on delete prohibited test spec
if: always() && steps.test-delete-prohibited.outcome != 'success'
run: exit 1
- name: Diagnosis after failure
if: ${{ failure() }}
run: |
sudo ls -lR /etc/apache2
sudo ls -lR /var/run/apache2
sudo cat /etc/apache2/conf.d/webauthn.conf
sudo cat /etc/apache2/conf.d/wsgi_webauthn2.conf
sudo cat /etc/apache2/conf.d/wsgi_ermrest.conf
sudo cat /var/log/apache2/error.log
sudo cat /var/log/apache2/access.log
sudo -H -u webauthn psql -c 'select * from webauthn2_db.session' webauthn