Skip to content

ci: run chaise tests against ermrestjs branch #2259

ci: run chaise tests against ermrestjs branch

ci: run chaise tests against ermrestjs branch #2259

Workflow file for this run

name: Chaise end-to-end tests
on: [push]
permissions:
contents: read
jobs:
install-and-test:
runs-on: ubuntu-24.04
strategy:
# allow all matrix jobs to complete
fail-fast: false
matrix:
node-version: ['20.x', '22.x', '24.x']
env:
SHARDING: true
HEADLESS: false
PYTHONWARNINGS: ignore:Unverified HTTPS request
NODE_TLS_REJECT_UNAUTHORIZED: '0'
DERIVA_WEB_EXPORT_CONIFG: ${{ vars.DERIVA_WEB_EXPORT_CONIFG }}
timeout-minutes: 60
steps:
- name: Checkout repository code
uses: actions/checkout@v6
with:
path: chaise
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: chaise/package-lock.json
- name: Setup the system
run: |
sudo timedatectl set-timezone America/Los_Angeles
export TZ=America/Los_Angeles
export PATH="$(systemd-path user-binaries):$PATH"
sudo apt-get update
sudo apt-get install -y --no-install-recommends $APT_PACKAGES
sudo service postgresql stop || true
sudo service postgresql start
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
echo "python3 version:"
sudo python3 --version
echo "pip3 version:"
sudo pip3 --version
env:
APT_PACKAGES: >
libcurl4-openssl-dev libjson-c-dev
python3-psycopg2 python3-pip python3-setuptools python3-ply
apache2 apache2-dev ssl-cert libapache2-mod-wsgi-py3 ca-certificates
python3-cryptography python3-openssl python3-oauth2client
python3-flask python3-requests
- name: Install webauthn
run: |
git clone https://github.com/informatics-isi-edu/webauthn.git
cd webauthn
sudo useradd -m -r 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 -H make deploy PLATFORM=ubuntu1604
sudo bash ./test/ubuntu-travis-setup.sh
cd ../chaise
sudo cp test/ermrest_config.json /home/ermrest/
sudo chmod a+r /home/ermrest/ermrest_config.json
sudo service apache2 restart
- name: Install deriva-web
run: |
git clone https://github.com/informatics-isi-edu/deriva-web.git
cd deriva-web
sudo make install
sudo useradd -m -g apache -r deriva
sudo make deploy
echo "$DERIVA_WEB_EXPORT_CONIFG" | sudo tee /home/deriva/conf.d/export/export_config.json
- name: Install ermresolve
run: |
git clone https://github.com/informatics-isi-edu/ermresolve.git ermresolve
cd ermresolve
sudo pip3 install .
sudo useradd -m -g apache -r ermresolve
sudo chmod og+rx /home/ermresolve
sudo make deploy
sudo ln -s /etc/apache2/mods-available/unique_id.load /etc/apache2/mods-enabled/unique_id.load
sudo service apache2 restart
- name: Install ermrestjs
run: |
git clone https://github.com/informatics-isi-edu/ermrestjs.git
cd ermrestjs
git checkout core-ts-migration
sudo make root-install
- name: Install chaise (build & deploy)
run: |
cd chaise
sudo make root-install
- name: Cache Playwright browsers
id: playwright-cache
uses: actions/cache@v5
with:
path: ~/.cache/ms-playwright
key: playwright-browsers-${{ runner.os }}-node${{ matrix.node-version }}-${{ hashFiles('chaise/package-lock.json') }}
- name: Install chaise dev deps and Playwright
run: |
cd chaise
NODE_ENV=development npm clean-install --include=dev
if [ "${{ steps.playwright-cache.outputs.cache-hit }}" == "true" ]; then
npx playwright install-deps
else
npx playwright install --with-deps --no-shell
fi
make lint
- 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: Run default config test spec
id: test-default-config
continue-on-error: true
run: |
cd chaise
make testdefaultconfig
- name: Run delete prohibited test spec
id: test-delete-prohibited
continue-on-error: true
run: |
cd chaise
make testdeleteprohibited
- name: Run all features confirmation test spec
id: test-all-features-confirmation
continue-on-error: true
run: |
cd chaise
make testallfeaturesconfirmation
- name: Run all features test spec
id: test-all-features
continue-on-error: true
run: |
cd chaise
make testallfeatures
- name: Check on default config test spec
if: always() && steps.test-default-config.outcome != 'success'
run: exit 1
- name: Check on delete prohibited test spec
if: always() && steps.test-delete-prohibited.outcome != 'success'
run: exit 1
- name: Check on all features confirmation test spec
if: always() && steps.test-all-features-confirmation.outcome != 'success'
run: exit 1
- name: Check on all features test spec
if: always() && steps.test-all-features.outcome != 'success'
run: exit 1
- uses: actions/upload-artifact@v7
if: always()
with:
name: playwright-report-${{ matrix.node-version }}
path: |
chaise/playwright-report/
retention-days: 30
- name: Diagnosis after failure
if: ${{ failure() }}
run: |
sudo ls -lR /etc/apache2
sudo ls -lR /etc/apache2/mods-enabled
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 /etc/apache2/conf.d/wsgi_ermresolve.conf
sudo ls -lR /var/log/apache2
sudo cat /var/log/apache2/error.log
sudo cat /var/log/apache2/access.log
sudo cat /var/log/syslog
sudo -H -u webauthn psql -c 'select * from webauthn2_db.session' webauthn