From 1830a657a4f402ecc2903ef4b4fdc34f91d137c7 Mon Sep 17 00:00:00 2001 From: Tom Herold Date: Mon, 21 Oct 2024 11:23:37 +0200 Subject: [PATCH] convert wkorg nightly screenshot test from CircleCI to GitHub actions --- .circleci/config.yml | 38 ------------------------- .github/workflows/nightly.yml | 2 +- .github/workflows/wkorg-nightly.yaml | 42 +++++++++++++++++++++++++++- 3 files changed, 42 insertions(+), 40 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e37a7a17a2..4838450110 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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: diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 3fc91c00ed..8b28bc1655 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -7,7 +7,7 @@ on: - cron: '0 0 * * *' jobs: - nightly: + nightly-screenshot-tests: runs-on: ubuntu-latest container: image: scalableminds/puppeteer:fix_wk_nightly diff --git a/.github/workflows/wkorg-nightly.yaml b/.github/workflows/wkorg-nightly.yaml index 8a4e8dbab7..4ccf7d641c 100644 --- a/.github/workflows/wkorg-nightly.yaml +++ b/.github/workflows/wkorg-nightly.yaml @@ -15,4 +15,44 @@ jobs: - name: Checkout code uses: actions/checkout@v3 - \ No newline at end of file + - 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. \ No newline at end of file