Skip to content

Commit

Permalink
convert wkorg nightly screenshot test from CircleCI to GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
hotzenklotz committed Oct 21, 2024
1 parent b9db33e commit 1830a65
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 40 deletions.
38 changes: 0 additions & 38 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -256,44 +256,6 @@ jobs:
- store_artifacts:
path: screenshots.tar

wkorg_nightly:
docker:
- image: scalableminds/puppeteer:fix_wk_nightly
resource_class: large
steps:
- checkout
- run:
name: Install dependencies
command: |
yarn install --immutable
- run:
name: Assert GZIP
command: |
# Test gzipped assets
curl -s -I -H "Accept-Encoding: gzip" https://webknossos.org/assets/bundle/main.js | grep -q "content-encoding: gzip"
curl -s -I -H "Accept-Encoding: gzip" https://webknossos.org/assets/bundle/main.css | grep -q "content-encoding: gzip"
# Test gzipped buckets
curl -s -i \
-H 'accept: application/octet-stream' \
-H 'Accept-Encoding: gzip' \
-H 'content-type: application/json' \
--data-raw '[{"position":[2752,4320,1728],"additionalCoordinates":[],"mag":[1,1,1],"cubeSize":32,"fourBit":false}]' \
'https://data-humerus.webknossos.org/data/datasets/scalable_minds/l4dense_motta_et_al_demo/layers/segmentation/data?token=' \
| grep -q "content-encoding: gzip"
echo Success.
- run:
name: Run screenshot-tests
command: |
# CircleCI cancels the job after 60 minutes. To ensure that screenshots are still
# uploaded as artifacts, we define a timeout of 50 minutes for the screenshot tests.
timeout 3000 \
yarn test-wkorg-screenshot
- store_artifacts:
path: frontend/javascripts/test/screenshots-wkorg

workflows:
version: 2
circleci_build:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- cron: '0 0 * * *'

jobs:
nightly:
nightly-screenshot-tests:
runs-on: ubuntu-latest
container:
image: scalableminds/puppeteer:fix_wk_nightly
Expand Down
42 changes: 41 additions & 1 deletion .github/workflows/wkorg-nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,44 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3


- uses: actions/setup-node@v4
with:
node-version: 18

- name: Install dependencies
run: |
corepack enable && yarn install --immutable
- name: Run screenshot tests
run: |
yarn test-wkorg-screenshot
env:
URL: https://webknossos.org/
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY : ${{ secrets.BROWSERSTACK_ACCESS_KEY }}

- name: Upload screenshots as artifact
uses: actions/upload-artifact@v3
with:
name: screenshots
path: frontend/javascripts/test/screenshots-wkorg


nightly-gzip-test:
runs-on: ubuntu-latest

steps:
- name: Assert GZIP is enabled
run: |
# Test gzipped assets
curl -s -I -H "Accept-Encoding: gzip" https://webknossos.org/assets/bundle/main.js | grep -q "content-encoding: gzip"
curl -s -I -H "Accept-Encoding: gzip" https://webknossos.org/assets/bundle/main.css | grep -q "content-encoding: gzip"
# Test gzipped buckets
curl -s -i \
-H 'accept: application/octet-stream' \
-H 'Accept-Encoding: gzip' \
-H 'content-type: application/json' \
--data-raw '[{"position":[2752,4320,1728],"additionalCoordinates":[],"mag":[1,1,1],"cubeSize":32,"fourBit":false}]' \
'https://data-humerus.webknossos.org/data/datasets/scalable_minds/l4dense_motta_et_al_demo/layers/segmentation/data?token=' \
| grep -q "content-encoding: gzip"
echo Success.

0 comments on commit 1830a65

Please sign in to comment.