-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Autoscaling github runners - fast fix (#6168)
* initial commit. config changes and scripts * add workflow config * fix unstable macro tests * fix microtests * fix test * try shard macro * try to use full sharding
- Loading branch information
1 parent
fd39f41
commit 02a8413
Showing
24 changed files
with
291 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,174 @@ | ||
name: Run Playwright Tests | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- 'release/**' | ||
pull_request: | ||
branches: | ||
- master | ||
- 'release/**' | ||
workflow_dispatch: | ||
|
||
env: | ||
# Warnings breaks build on CI | ||
# See: https://github.com/orgs/community/discussions/25228#discussioncomment-3246960 | ||
CI: false | ||
MODE: standalone | ||
KETCHER_URL: http://127.0.0.1:4002 | ||
DOCKER: true | ||
IGNORE_UNSTABLE_TESTS: true | ||
CI_ENVIRONMENT: true | ||
USE_SEPARATE_INDIGO_WASM: true | ||
jobs: | ||
build_ketcher_micro: | ||
runs-on: ubuntu-latest | ||
container: node:18.14-bullseye-slim | ||
env: | ||
ENABLE_POLYMER_EDITOR: false | ||
steps: | ||
- name: Install dependencies | ||
run: apt-get update -y && apt-get install -y git | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
- name: Git safe | ||
run: git config --global --add safe.directory '*' | ||
- name: Install NPM dependencies | ||
run: npm ci | ||
- name: Build all packages | ||
run: npm run build:packages && npm run build:example:standalone | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ketcher-dist-micro | ||
path: example/dist | ||
|
||
build_ketcher_macro: | ||
runs-on: ubuntu-latest | ||
container: node:18.14-bullseye-slim | ||
env: | ||
ENABLE_POLYMER_EDITOR: true | ||
steps: | ||
- name: Install dependencies | ||
run: apt-get update -y && apt-get install -y git | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
- name: Git safe | ||
run: git config --global --add safe.directory '*' | ||
- name: Install NPM dependencies | ||
run: npm ci | ||
- name: Build all packages | ||
run: npm run build:packages && npm run build:example:standalone | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ketcher-dist-macro | ||
path: example/dist | ||
|
||
playwright_tests_micro: | ||
timeout-minutes: 120 | ||
runs-on: self-hosted-a | ||
needs: build_ketcher_micro | ||
container: mcr.microsoft.com/playwright:v1.44.1-jammy | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
shardIndex: [1, 2] | ||
shardTotal: [2] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Create folder for dist | ||
run: mkdir -p example/dist | ||
- name: Download compiled ketcher | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ketcher-dist-micro | ||
path: example/dist/ | ||
- name: Create env file | ||
env: | ||
ENABLE_POLYMER_EDITOR: false | ||
run: | | ||
cat > ketcher-autotests/.env << EOF | ||
DOCKER=true | ||
KETCHER_URL=$KETCHER_URL | ||
MODE=$MODE | ||
IGNORE_UNSTABLE_TESTS=$IGNORE_UNSTABLE_TESTS | ||
CI_ENVIRONMENT=$CI_ENVIRONMENT | ||
USE_SEPARATE_INDIGO_WASM=$USE_SEPARATE_INDIGO_WASM | ||
ENABLE_POLYMER_EDITOR=$ENABLE_POLYMER_EDITOR | ||
EOF | ||
- name: Run tests | ||
run: | | ||
cd example/ && nohup npm run serve:standalone & | ||
cd ketcher-autotests/ | ||
npm i | ||
npx playwright install chromium | ||
npx playwright test --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} | ||
- uses: actions/upload-artifact@v3 | ||
# run even if previous steps fails | ||
if: always() | ||
with: | ||
name: playwright-report-micro-${{ matrix.shardIndex }} | ||
path: ketcher-autotests/playwright-report/ | ||
retention-days: 5 | ||
|
||
playwright_tests_macromolecules: | ||
timeout-minutes: 120 | ||
runs-on: self-hosted-a | ||
needs: build_ketcher_macro | ||
container: mcr.microsoft.com/playwright:v1.44.1-jammy | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
shardIndex: [1, 2, 3, 4] | ||
shardTotal: [4] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Create folder for dist | ||
run: mkdir -p example/dist | ||
- name: Download compiled ketcher | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ketcher-dist-macro | ||
path: example/dist/ | ||
- name: Create env file | ||
env: | ||
ENABLE_POLYMER_EDITOR: true | ||
run: | | ||
cat > ketcher-autotests/.env << EOF | ||
DOCKER=true | ||
KETCHER_URL=$KETCHER_URL | ||
MODE=$MODE | ||
IGNORE_UNSTABLE_TESTS=$IGNORE_UNSTABLE_TESTS | ||
CI_ENVIRONMENT=$CI_ENVIRONMENT | ||
USE_SEPARATE_INDIGO_WASM=$USE_SEPARATE_INDIGO_WASM | ||
ENABLE_POLYMER_EDITOR=$ENABLE_POLYMER_EDITOR | ||
EOF | ||
- name: Run tests | ||
run: | | ||
cd example/ && nohup npm run serve:standalone & | ||
cd ketcher-autotests/ | ||
npm i | ||
npx playwright install chromium | ||
npx playwright test --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} | ||
- uses: actions/upload-artifact@v3 | ||
# run even if previous steps fails | ||
if: always() | ||
with: | ||
name: playwright-report-macromolecules-${{ matrix.shardIndex }} | ||
path: ketcher-autotests/playwright-report/ | ||
retention-days: 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,8 @@ yarn-error.log* | |
|
||
.vscode | ||
/.idea | ||
nohup.out | ||
ketcher-autotests/results.json | ||
|
||
.pnp.* | ||
.yarn/* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
KETCHER_URL=http://host.docker.internal:4002 | ||
# KETCHER_URL=http://localhost:4002 | ||
# KETCHER_URL=http://host.docker.internal:5173 | ||
KETCHER_URL=http://localhost:4002 | ||
MODE="standalone" | ||
DOCKER=true | ||
IGNORE_UNSTABLE_TESTS=true | ||
GENERATE_DATA=false | ||
ENABLE_POLYMER_EDITOR = false | ||
CI_ENVIRONMENT=false | ||
ENABLE_POLYMER_EDITOR=false | ||
CI_ENVIRONMENT=false | ||
NUM_WORKERS=8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
|
||
FROM node:18-alpine | ||
FROM mcr.microsoft.com/playwright:v1.44.1-jammy | ||
|
||
WORKDIR /app | ||
|
||
COPY . . | ||
|
||
RUN npm i && npx playwright install chromium |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM node:18.14-bullseye-slim | ||
|
||
RUN apt-get update -y && apt-get install -y git | ||
|
||
WORKDIR /ketcher |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,26 @@ | ||
version: '3' | ||
services: | ||
ketcher: | ||
build: | ||
context: ./reporters/ | ||
dockerfile: ../Dockerfile-ketcher | ||
env_file: | ||
.env | ||
volumes: | ||
- ./:/app | ||
- ../:/ketcher | ||
autotests: | ||
build: | ||
context: . | ||
context: ./reporters/ | ||
dockerfile: ../Dockerfile | ||
container_name: ketcher-autotest | ||
env_file: | ||
.env | ||
network_mode: "host" | ||
extra_hosts: | ||
- "host.docker.internal:host-gateway" | ||
# network_mode: "host" | ||
# extra_hosts: | ||
# - "host.docker.internal:host-gateway" | ||
# ports: | ||
# - "4002:4002" | ||
volumes: | ||
- ./:/app | ||
- /app/node_modules | ||
- ../:/ketcher |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.