From 8f3498623f4c29d8d5d2f8964c33269c0d207e51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oleksis=20Fraga=20Men=C3=A9ndez?= <44526468+oleksis@users.noreply.github.com> Date: Fri, 6 Oct 2023 02:56:21 +0000 Subject: [PATCH] Update Playwright workflow use Jekyll detached and pytest Update test for use live server url to 127.0.0.1:4000 Add docker-in-docker and act devcontainer features --- .devcontainer/devcontainer.json | 4 +++- .github/workflows/playwright.yml | 15 ++++++++------- .gitignore | 1 + .ruby-version | 1 + tests/test.py | 2 +- 5 files changed, 14 insertions(+), 9 deletions(-) create mode 100644 .ruby-version diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 5d92d1d..c913313 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -7,7 +7,9 @@ // Features to add to the dev container. More info: https://containers.dev/features. "features": { - "ghcr.io/devcontainers-contrib/features/pre-commit:2": {} + "ghcr.io/devcontainers-contrib/features/pre-commit:2": {}, + "ghcr.io/devcontainers/features/docker-in-docker": {}, + "ghcr.io/devcontainers-contrib/features/act:1": {} }, // Use 'forwardPorts' to make a list of ports inside the container available locally. diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 0089644..22f10f6 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -22,10 +22,11 @@ jobs: python -m pip install --upgrade pip pip install -r requirements-dev.txt python -m playwright install --with-deps - - name: Jekyll detached - run: bundle exec jekyll serve --detach - - name: Sleep for 45 seconds - run: sleep 45s - shell: bash - - name: Run tests - run: python -m pytest + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + - name: Jekyll detached and pytest + run: | + bundle exec jekyll serve --detach + python -m pytest diff --git a/.gitignore b/.gitignore index 19561ff..840c086 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ venv .jekyll-metadata **/__pycache__ .pytest_cache +bin/ diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..be94e6f --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +3.2.2 diff --git a/tests/test.py b/tests/test.py index f2999fb..c970c23 100644 --- a/tests/test.py +++ b/tests/test.py @@ -1,7 +1,7 @@ import pytest from playwright.sync_api import Page, expect -live_server_url = "http://localhost:4000" +live_server_url = "http://127.0.0.1:4000" routes = [ ("about.html"),