From 746fb9d5b91f5002f6d413fdd335f7215e24e6ff Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Wed, 14 Aug 2024 14:35:10 -0700 Subject: [PATCH 01/53] add lint gh action --- .github/workflows/lint.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..ec3c934b --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,38 @@ +name: lint + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.11"] + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pre-commit + pre-commit install-hooks + - name: install cucu dependencies + run: | + python -m virtualenv --upgrade-embed-wheels + poetry install --no-ansi + - name: build the cucu python package + run: poetry build + - name: install cucu globally + run: pip install dist/cucu-*.tar.gz + - name: run pre-commit validations + run: pre-commit run --show-diff-on-failure --from-ref origin/HEAD --to-ref HEAD From 2e3a0f9682b7901282cea4eb0fc8360dd28b2f24 Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Wed, 14 Aug 2024 14:38:48 -0700 Subject: [PATCH 02/53] add poetry --- .github/workflows/lint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ec3c934b..4e638d03 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -10,7 +10,7 @@ permissions: contents: read jobs: - build: + lint: runs-on: ubuntu-latest strategy: matrix: @@ -24,7 +24,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install pre-commit + pip install pre-commit poetry pre-commit install-hooks - name: install cucu dependencies run: | From 545dd4bd7ce788ade086501c8833dc699eb197dd Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Wed, 14 Aug 2024 14:45:15 -0700 Subject: [PATCH 03/53] use pre-commit action --- .github/workflows/lint.yml | 34 +++++----------------------------- 1 file changed, 5 insertions(+), 29 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4e638d03..14fda46f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,38 +1,14 @@ name: lint on: - push: - branches: [ "main" ] pull_request: - branches: [ "main" ] - -permissions: - contents: read + push: + branches: [main] jobs: lint: runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.11"] steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install pre-commit poetry - pre-commit install-hooks - - name: install cucu dependencies - run: | - python -m virtualenv --upgrade-embed-wheels - poetry install --no-ansi - - name: build the cucu python package - run: poetry build - - name: install cucu globally - run: pip install dist/cucu-*.tar.gz - - name: run pre-commit validations - run: pre-commit run --show-diff-on-failure --from-ref origin/HEAD --to-ref HEAD + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - uses: pre-commit/action@v3.0.1 From 9c2e5f5d23d6c48fabf7e49e5cbdb81f11811f9e Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Wed, 14 Aug 2024 14:47:48 -0700 Subject: [PATCH 04/53] install poetry --- .github/workflows/lint.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 14fda46f..ed56816f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,4 +1,4 @@ -name: lint +name: pre-commit on: pull_request: @@ -6,9 +6,12 @@ on: branches: [main] jobs: - lint: + pre-commit: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v3 + - name: Install poetry + run: | + pip install poetry - uses: pre-commit/action@v3.0.1 From 3e2c543e679f56ea7d676cdfc532e5c589b93110 Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Wed, 14 Aug 2024 14:49:33 -0700 Subject: [PATCH 05/53] install hooks --- .github/workflows/lint.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ed56816f..c28e2ad5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,7 +11,8 @@ jobs: steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v3 - - name: Install poetry + - name: Install depedencies run: | - pip install poetry + pip install pre-commit poetry + pre-commit install-hooks - uses: pre-commit/action@v3.0.1 From b93e8654a4e8a606dfb00698f3084b12d5bc97cb Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Wed, 14 Aug 2024 14:50:49 -0700 Subject: [PATCH 06/53] install cucu --- .github/workflows/lint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index c28e2ad5..a044f1e7 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,6 +13,6 @@ jobs: - uses: actions/setup-python@v3 - name: Install depedencies run: | - pip install pre-commit poetry - pre-commit install-hooks + pip install poetry + poetry install --no-ansi - uses: pre-commit/action@v3.0.1 From 5c562a1623794572b9bccaa6c086fecae59bdd5f Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Wed, 14 Aug 2024 14:54:21 -0700 Subject: [PATCH 07/53] remove lint from circle --- .circleci/config.yml | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0d820503..d0a73b47 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -26,53 +26,17 @@ parameters: workflows: build-test-publish: jobs: - - pre-commit - test: name: test-chrome browser: chrome - requires: - - pre-commit - test: name: test-edge browser: edge - requires: - - pre-commit - test: name: test-firefox browser: firefox - requires: - - pre-commit jobs: - pre-commit: - docker: - - image: cimg/python:<> - resource_class: medium - steps: - - checkout - - run: - name: install dependencies - command: | - set +eo pipefail - pip install --upgrade pip - pip install pre-commit - pre-commit install-hooks - - run: - name: install cucu dependencies - command: | - set +eo pipefail - python -m virtualenv --upgrade-embed-wheels - poetry install --no-ansi - - run: - name: build the cucu python package - command: poetry build - - run: - name: install cucu globally - command: pip install dist/cucu-*.tar.gz - - run: - name: run pre-commit validations - command: pre-commit run --show-diff-on-failure --from-ref origin/HEAD --to-ref HEAD - test: parameters: browser: From bae92b7745917d9209f19aade3b407abe8e5b825 Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Wed, 14 Aug 2024 14:57:25 -0700 Subject: [PATCH 08/53] add unit test --- .github/workflows/lint.yml | 4 ++-- .github/workflows/unit-test.yml | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/unit-test.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a044f1e7..a3e84df9 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,4 +1,4 @@ -name: pre-commit +name: lint on: pull_request: @@ -6,7 +6,7 @@ on: branches: [main] jobs: - pre-commit: + lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml new file mode 100644 index 00000000..7c6c5edc --- /dev/null +++ b/.github/workflows/unit-test.yml @@ -0,0 +1,20 @@ +name: unit-test + +on: + pull_request: + push: + branches: [main] + +jobs: + unit-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - name: Install depedencies + run: | + pip install poetry + poetry install --no-ansi + - name: unit tests + run: | + poetry run coverage run -m pytest --junit-xml=results/unit-tests.xml From 243a9440b29390f7ad241f5a49cde28d28e679cc Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Wed, 14 Aug 2024 15:12:42 -0700 Subject: [PATCH 09/53] combine workflows --- .github/workflows/{unit-test.yml => build.yml} | 13 ++++++++++++- .github/workflows/lint.yml | 18 ------------------ 2 files changed, 12 insertions(+), 19 deletions(-) rename .github/workflows/{unit-test.yml => build.yml} (59%) delete mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/unit-test.yml b/.github/workflows/build.yml similarity index 59% rename from .github/workflows/unit-test.yml rename to .github/workflows/build.yml index 7c6c5edc..a66851b8 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: unit-test +name: build on: pull_request: @@ -6,6 +6,17 @@ on: branches: [main] jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - name: Install depedencies + run: | + pip install poetry + poetry install --no-ansi + - uses: pre-commit/action@v3.0.1 + unit-test: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index a3e84df9..00000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: lint - -on: - pull_request: - push: - branches: [main] - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 - - name: Install depedencies - run: | - pip install poetry - poetry install --no-ansi - - uses: pre-commit/action@v3.0.1 From 84f8753c5bd7c1de5b61f41538f3aba2b6942af8 Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Thu, 15 Aug 2024 11:10:57 -0700 Subject: [PATCH 10/53] add filepath --- tests/test_core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_core.py b/tests/test_core.py index 6259d333..1ef51800 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -19,7 +19,7 @@ def process_func_to_run_cucu(workers, runtime_timeout): runner = CliRunner() runner.invoke( core.run, - f"--runtime-timeout {runtime_timeout} --workers={workers} abc", + f"data/features/slow_features --runtime-timeout {runtime_timeout} --workers={workers} abc", ) From 0e67303d52853c0229b9af2fad6d704cd7da6817 Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Thu, 15 Aug 2024 11:25:13 -0700 Subject: [PATCH 11/53] add ui tests --- .github/workflows/build.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a66851b8..ae3fbbdb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,3 +29,32 @@ jobs: - name: unit tests run: | poetry run coverage run -m pytest --junit-xml=results/unit-tests.xml + + UI-test: + runs-on: ubuntu-latest + + container: + image: selenium/standalone-chrome:124.0 + ports: + - 4444:4444 + env: + SE_NODE_MAX_SESSIONS: 12 + SE_NODE_SESSION_TIMEOUT: 300 + SCREEN_WIDTH: 1366 + SCREEN_HEIGHT: 768 + + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - name: Install depedencies + run: | + pip install poetry + poetry install --no-ansi + - name: wait for selenium + run: | + curl --retry 60 --retry-delay 5 --retry-connrefused http://localhost:4444 + - name: UI tests + env: + COVERAGE_PROCESS_START: pyproject.toml + run: | + poetry run cucu run features --workers 6 --selenium-remote-url http://localhost:4444 --generate-report --junit junit_results --browser "chrome" From ea49af6cee4a669478f61a57d43adae6206fedb8 Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Thu, 15 Aug 2024 11:59:52 -0700 Subject: [PATCH 12/53] add option to selenium docker --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ae3fbbdb..e59685d4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,6 +35,7 @@ jobs: container: image: selenium/standalone-chrome:124.0 + options: --shm-size=2gb ports: - 4444:4444 env: From ec0b5079e99bf585e6bde908ffa684e004b8846d Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Thu, 15 Aug 2024 12:01:06 -0700 Subject: [PATCH 13/53] better names --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e59685d4..f025a27d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ jobs: poetry install --no-ansi - uses: pre-commit/action@v3.0.1 - unit-test: + API-tests: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -30,7 +30,7 @@ jobs: run: | poetry run coverage run -m pytest --junit-xml=results/unit-tests.xml - UI-test: + UI-tests: runs-on: ubuntu-latest container: From a32e7f47b77b7ff34b915aa1d661531378427f6f Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Thu, 15 Aug 2024 13:50:55 -0700 Subject: [PATCH 14/53] fix checkout --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f025a27d..68c6b120 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,6 +46,9 @@ jobs: steps: - uses: actions/checkout@v3 + with: + clean: false + set-safe-directory: false - uses: actions/setup-python@v3 - name: Install depedencies run: | From 30f84f7949077eccb6ce36c0edb441056e80b18d Mon Sep 17 00:00:00 2001 From: Cedric <95940265+ddl-cedricyoung@users.noreply.github.com> Date: Thu, 15 Aug 2024 13:58:43 -0700 Subject: [PATCH 15/53] bump versions --- .github/workflows/build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 68c6b120..8786fe43 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,8 +9,8 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 - name: Install depedencies run: | pip install poetry @@ -20,8 +20,8 @@ jobs: API-tests: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 - name: Install depedencies run: | pip install poetry @@ -45,11 +45,11 @@ jobs: SCREEN_HEIGHT: 768 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: clean: false set-safe-directory: false - - uses: actions/setup-python@v3 + - uses: actions/setup-python@v5 - name: Install depedencies run: | pip install poetry From 7617c057b096a54b7c74c4bcb21b7e59f47471fa Mon Sep 17 00:00:00 2001 From: Cedric <95940265+ddl-cedricyoung@users.noreply.github.com> Date: Thu, 15 Aug 2024 14:03:40 -0700 Subject: [PATCH 16/53] fix permissions --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8786fe43..95301192 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,6 +45,9 @@ jobs: SCREEN_HEIGHT: 768 steps: + - name: Fix permissions after selenium starts up + run: | + sudo chmod -R a+rwx /__w - uses: actions/checkout@v4 with: clean: false From 1e7e93536227a833cdb60cb17ba60ffc6126aa23 Mon Sep 17 00:00:00 2001 From: Cedric <95940265+ddl-cedricyoung@users.noreply.github.com> Date: Thu, 15 Aug 2024 14:06:17 -0700 Subject: [PATCH 17/53] comment and isolate --- .github/workflows/build.yml | 77 ++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 40 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 95301192..d1e7b5b4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,52 +6,49 @@ on: branches: [main] jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - - name: Install depedencies - run: | - pip install poetry - poetry install --no-ansi - - uses: pre-commit/action@v3.0.1 + # lint: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # - uses: actions/setup-python@v5 + # - name: Install depedencies + # run: | + # pip install poetry + # poetry install --no-ansi + # - uses: pre-commit/action@v3.0.1 - API-tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - - name: Install depedencies - run: | - pip install poetry - poetry install --no-ansi - - name: unit tests - run: | - poetry run coverage run -m pytest --junit-xml=results/unit-tests.xml + # API-tests: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # - uses: actions/setup-python@v5 + # - name: Install depedencies + # run: | + # pip install poetry + # poetry install --no-ansi + # - name: unit tests + # run: | + # poetry run coverage run -m pytest --junit-xml=results/unit-tests.xml UI-tests: runs-on: ubuntu-latest - container: - image: selenium/standalone-chrome:124.0 - options: --shm-size=2gb - ports: - - 4444:4444 - env: - SE_NODE_MAX_SESSIONS: 12 - SE_NODE_SESSION_TIMEOUT: 300 - SCREEN_WIDTH: 1366 - SCREEN_HEIGHT: 768 + # container: + # image: selenium/standalone-chrome:124.0 + # options: --shm-size=2gb + # ports: + # - 4444:4444 + # env: + # SE_NODE_MAX_SESSIONS: 12 + # SE_NODE_SESSION_TIMEOUT: 300 + # SCREEN_WIDTH: 1366 + # SCREEN_HEIGHT: 768 steps: - - name: Fix permissions after selenium starts up - run: | - sudo chmod -R a+rwx /__w - uses: actions/checkout@v4 - with: - clean: false - set-safe-directory: false + # with: + # clean: false + # set-safe-directory: false - uses: actions/setup-python@v5 - name: Install depedencies run: | @@ -61,7 +58,7 @@ jobs: run: | curl --retry 60 --retry-delay 5 --retry-connrefused http://localhost:4444 - name: UI tests - env: - COVERAGE_PROCESS_START: pyproject.toml + # env: + # COVERAGE_PROCESS_START: pyproject.toml run: | poetry run cucu run features --workers 6 --selenium-remote-url http://localhost:4444 --generate-report --junit junit_results --browser "chrome" From 813209b9eeee9ca2630e55f6156aee792ef954a2 Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Thu, 15 Aug 2024 14:07:04 -0700 Subject: [PATCH 18/53] disable circle --- .circleci/config.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d0a73b47..a2746e7e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,17 +24,17 @@ parameters: default: 768 workflows: - build-test-publish: - jobs: - - test: - name: test-chrome - browser: chrome - - test: - name: test-edge - browser: edge - - test: - name: test-firefox - browser: firefox + # build-test-publish: + # jobs: + # - test: + # name: test-chrome + # browser: chrome + # - test: + # name: test-edge + # browser: edge + # - test: + # name: test-firefox + # browser: firefox jobs: test: From a12f72775370fcb33c8d20cabc342bc952adaa2f Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Thu, 15 Aug 2024 15:44:05 -0700 Subject: [PATCH 19/53] run selenium directly --- .github/workflows/build.yml | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d1e7b5b4..25e61955 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,19 +46,35 @@ jobs: steps: - uses: actions/checkout@v4 - # with: - # clean: false - # set-safe-directory: false - uses: actions/setup-python@v5 - name: Install depedencies run: | pip install poetry poetry install --no-ansi - - name: wait for selenium + + - name: Install Google Chrome + run: | + sudo apt-get update + sudo apt-get install -y wget + wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb + sudo apt install -y ./google-chrome-stable_current_amd64.deb + + - name: Install ChromeDriver run: | - curl --retry 60 --retry-delay 5 --retry-connrefused http://localhost:4444 + CHROME_DRIVER_VERSION=$(curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE) + wget https://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip + unzip chromedriver_linux64.zip + sudo mv chromedriver /usr/local/bin/chromedriver + sudo chmod +x /usr/local/bin/chromedriver + - name: UI tests # env: # COVERAGE_PROCESS_START: pyproject.toml run: | poetry run cucu run features --workers 6 --selenium-remote-url http://localhost:4444 --generate-report --junit junit_results --browser "chrome" + env: + SE_NODE_MAX_SESSIONS: 12 + SE_NODE_SESSION_TIMEOUT: 300 + SCREEN_WIDTH: 1366 + SCREEN_HEIGHT: 768 + DISPLAY: :99 # Needed for headless mode From 1571fc9db570857849fd0b4f803791eb95d918e9 Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Thu, 15 Aug 2024 15:58:26 -0700 Subject: [PATCH 20/53] disable chrome install --- .github/workflows/build.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 25e61955..f300d81e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -52,20 +52,20 @@ jobs: pip install poetry poetry install --no-ansi - - name: Install Google Chrome - run: | - sudo apt-get update - sudo apt-get install -y wget - wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb - sudo apt install -y ./google-chrome-stable_current_amd64.deb + # - name: Install Google Chrome + # run: | + # sudo apt-get update + # sudo apt-get install -y wget + # wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb + # sudo apt install -y ./google-chrome-stable_current_amd64.deb - - name: Install ChromeDriver - run: | - CHROME_DRIVER_VERSION=$(curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE) - wget https://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip - unzip chromedriver_linux64.zip - sudo mv chromedriver /usr/local/bin/chromedriver - sudo chmod +x /usr/local/bin/chromedriver + # - name: Install ChromeDriver + # run: | + # CHROME_DRIVER_VERSION=$(curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE) + # wget https://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip + # unzip chromedriver_linux64.zip + # sudo mv chromedriver /usr/local/bin/chromedriver + # sudo chmod +x /usr/local/bin/chromedriver - name: UI tests # env: From 61d13eb6452ba6c3c83bdb7ce1474c8bfffa4e00 Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Thu, 15 Aug 2024 16:01:46 -0700 Subject: [PATCH 21/53] wait for selenium --- .github/workflows/build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f300d81e..8bc02769 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -67,6 +67,10 @@ jobs: # sudo mv chromedriver /usr/local/bin/chromedriver # sudo chmod +x /usr/local/bin/chromedriver + - name: wait_for_selenium + # retry connection every 5s x 60 which is a total of 5 minutes + run: curl --retry 2 --retry-delay 2 --retry-connrefused http://localhost:4444 + - name: UI tests # env: # COVERAGE_PROCESS_START: pyproject.toml @@ -78,3 +82,5 @@ jobs: SCREEN_WIDTH: 1366 SCREEN_HEIGHT: 768 DISPLAY: :99 # Needed for headless mode + SELENIUM_HOST: localhost + SELENIUM_PORT: 4444 From f3bea5dd92a1bc0cb5e58e53ac633396fd5323e0 Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Thu, 15 Aug 2024 16:15:48 -0700 Subject: [PATCH 22/53] single worker --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8bc02769..bbf55302 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -75,7 +75,7 @@ jobs: # env: # COVERAGE_PROCESS_START: pyproject.toml run: | - poetry run cucu run features --workers 6 --selenium-remote-url http://localhost:4444 --generate-report --junit junit_results --browser "chrome" + poetry run cucu run features --workers 1 --generate-report --junit junit_results --browser "chrome" env: SE_NODE_MAX_SESSIONS: 12 SE_NODE_SESSION_TIMEOUT: 300 From c550c56f4fd392cb17bff504859c4d50d047c8c4 Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Thu, 15 Aug 2024 16:16:41 -0700 Subject: [PATCH 23/53] disable service --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bbf55302..2ff730bf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -67,9 +67,9 @@ jobs: # sudo mv chromedriver /usr/local/bin/chromedriver # sudo chmod +x /usr/local/bin/chromedriver - - name: wait_for_selenium + # - name: wait_for_selenium # retry connection every 5s x 60 which is a total of 5 minutes - run: curl --retry 2 --retry-delay 2 --retry-connrefused http://localhost:4444 + # run: curl --retry 2 --retry-delay 2 --retry-connrefused http://localhost:4444 - name: UI tests # env: From 3fbd17077995e6643681d2f7cab0135b8333df2b Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Fri, 16 Aug 2024 10:57:11 -0700 Subject: [PATCH 24/53] use browser action --- .github/workflows/build.yml | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2ff730bf..a0728ac0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -52,30 +52,21 @@ jobs: pip install poetry poetry install --no-ansi - # - name: Install Google Chrome - # run: | - # sudo apt-get update - # sudo apt-get install -y wget - # wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb - # sudo apt install -y ./google-chrome-stable_current_amd64.deb - - # - name: Install ChromeDriver - # run: | - # CHROME_DRIVER_VERSION=$(curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE) - # wget https://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip - # unzip chromedriver_linux64.zip - # sudo mv chromedriver /usr/local/bin/chromedriver - # sudo chmod +x /usr/local/bin/chromedriver + - uses: browser-actions/setup-chrome@v1 + with: + chrome-version: 120 + install-dependencies: true + install-chromedriver: true # - name: wait_for_selenium - # retry connection every 5s x 60 which is a total of 5 minutes - # run: curl --retry 2 --retry-delay 2 --retry-connrefused http://localhost:4444 + # # retry connection every 5s x 60 which is a total of 5 minutes + # run: curl --retry 2 --retry-delay 2 --retry-connrefused http://localhost:4444 - name: UI tests # env: # COVERAGE_PROCESS_START: pyproject.toml run: | - poetry run cucu run features --workers 1 --generate-report --junit junit_results --browser "chrome" + poetry run cucu run features/cli/help --workers 1 --generate-report --junit junit_results --browser "chrome" --selenium-remote-url http://localhost:4444 env: SE_NODE_MAX_SESSIONS: 12 SE_NODE_SESSION_TIMEOUT: 300 From 9ab61ae64703d1fb494bea58b84d54257b1eff91 Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Fri, 16 Aug 2024 10:59:27 -0700 Subject: [PATCH 25/53] install manually --- .github/workflows/build.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a0728ac0..aa31f3aa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -52,11 +52,17 @@ jobs: pip install poetry poetry install --no-ansi - - uses: browser-actions/setup-chrome@v1 - with: - chrome-version: 120 - install-dependencies: true - install-chromedriver: true + - name: Install Google Chrome and ChromeDriver + run: | + sudo apt-get update + sudo apt-get install -y wget + wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb + sudo apt install -y ./google-chrome-stable_current_amd64.deb + + wget https://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip + unzip chromedriver_linux64.zip + sudo mv chromedriver /usr/local/bin/chromedriver + sudo chmod +x /usr/local/bin/chromedriver # - name: wait_for_selenium # # retry connection every 5s x 60 which is a total of 5 minutes @@ -66,7 +72,7 @@ jobs: # env: # COVERAGE_PROCESS_START: pyproject.toml run: | - poetry run cucu run features/cli/help --workers 1 --generate-report --junit junit_results --browser "chrome" --selenium-remote-url http://localhost:4444 + poetry run cucu run features/cli/help.feature --workers 1 --generate-report --junit junit_results --browser "chrome" --selenium-remote-url http://localhost:4444 env: SE_NODE_MAX_SESSIONS: 12 SE_NODE_SESSION_TIMEOUT: 300 From e6478d45832d568c5a7659ad9345972c20bb0b68 Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Fri, 16 Aug 2024 11:01:28 -0700 Subject: [PATCH 26/53] disable UI tests --- .github/workflows/build.yml | 124 ++++++++++++++++++------------------ 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aa31f3aa..6eafa1b7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,44 +6,8 @@ on: branches: [main] jobs: - # lint: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v4 - # - uses: actions/setup-python@v5 - # - name: Install depedencies - # run: | - # pip install poetry - # poetry install --no-ansi - # - uses: pre-commit/action@v3.0.1 - - # API-tests: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v4 - # - uses: actions/setup-python@v5 - # - name: Install depedencies - # run: | - # pip install poetry - # poetry install --no-ansi - # - name: unit tests - # run: | - # poetry run coverage run -m pytest --junit-xml=results/unit-tests.xml - - UI-tests: + lint: runs-on: ubuntu-latest - - # container: - # image: selenium/standalone-chrome:124.0 - # options: --shm-size=2gb - # ports: - # - 4444:4444 - # env: - # SE_NODE_MAX_SESSIONS: 12 - # SE_NODE_SESSION_TIMEOUT: 300 - # SCREEN_WIDTH: 1366 - # SCREEN_HEIGHT: 768 - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 @@ -51,33 +15,69 @@ jobs: run: | pip install poetry poetry install --no-ansi + - uses: pre-commit/action@v3.0.1 - - name: Install Google Chrome and ChromeDriver + API-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + - name: Install depedencies run: | - sudo apt-get update - sudo apt-get install -y wget - wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb - sudo apt install -y ./google-chrome-stable_current_amd64.deb + pip install poetry + poetry install --no-ansi + - name: unit tests + run: | + poetry run coverage run -m pytest --junit-xml=results/unit-tests.xml - wget https://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip - unzip chromedriver_linux64.zip - sudo mv chromedriver /usr/local/bin/chromedriver - sudo chmod +x /usr/local/bin/chromedriver + # UI-tests: + # runs-on: ubuntu-latest - # - name: wait_for_selenium - # # retry connection every 5s x 60 which is a total of 5 minutes - # run: curl --retry 2 --retry-delay 2 --retry-connrefused http://localhost:4444 + # # container: + # # image: selenium/standalone-chrome:124.0 + # # options: --shm-size=2gb + # # ports: + # # - 4444:4444 + # # env: + # # SE_NODE_MAX_SESSIONS: 12 + # # SE_NODE_SESSION_TIMEOUT: 300 + # # SCREEN_WIDTH: 1366 + # # SCREEN_HEIGHT: 768 - - name: UI tests - # env: - # COVERAGE_PROCESS_START: pyproject.toml - run: | - poetry run cucu run features/cli/help.feature --workers 1 --generate-report --junit junit_results --browser "chrome" --selenium-remote-url http://localhost:4444 - env: - SE_NODE_MAX_SESSIONS: 12 - SE_NODE_SESSION_TIMEOUT: 300 - SCREEN_WIDTH: 1366 - SCREEN_HEIGHT: 768 - DISPLAY: :99 # Needed for headless mode - SELENIUM_HOST: localhost - SELENIUM_PORT: 4444 + # steps: + # - uses: actions/checkout@v4 + # - uses: actions/setup-python@v5 + # - name: Install depedencies + # run: | + # pip install poetry + # poetry install --no-ansi + + # - name: Install Google Chrome and ChromeDriver + # run: | + # sudo apt-get update + # sudo apt-get install -y wget + # wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb + # sudo apt install -y ./google-chrome-stable_current_amd64.deb + + # wget https://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip + # unzip chromedriver_linux64.zip + # sudo mv chromedriver /usr/local/bin/chromedriver + # sudo chmod +x /usr/local/bin/chromedriver + + # # - name: wait_for_selenium + # # # retry connection every 5s x 60 which is a total of 5 minutes + # # run: curl --retry 2 --retry-delay 2 --retry-connrefused http://localhost:4444 + + # - name: UI tests + # # env: + # # COVERAGE_PROCESS_START: pyproject.toml + # run: | + # poetry run cucu run features/cli/help.feature --workers 1 --generate-report --junit junit_results --browser "chrome" --selenium-remote-url http://localhost:4444 + # env: + # SE_NODE_MAX_SESSIONS: 12 + # SE_NODE_SESSION_TIMEOUT: 300 + # SCREEN_WIDTH: 1366 + # SCREEN_HEIGHT: 768 + # DISPLAY: :99 # Needed for headless mode + # SELENIUM_HOST: localhost + # SELENIUM_PORT: 4444 From 878dd3879116f45a4358ba14d14a90955f626dda Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Fri, 16 Aug 2024 11:07:34 -0700 Subject: [PATCH 27/53] re-enable circle tests --- .circleci/config.yml | 54 ++++++++++++++------------------------------ 1 file changed, 17 insertions(+), 37 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a2746e7e..cd56dce1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,38 +3,18 @@ --- version: 2.1 -parameters: - python_version: - type: string - default: '3.11.7' - selenium_version: - type: string - default: '124.0' - se_node_max_sessions: - type: integer - default: 12 - se_node_session_timeout: - type: integer - default: 300 - screen_width: - type: integer - default: 1366 - screen_height: - type: integer - default: 768 - workflows: - # build-test-publish: - # jobs: - # - test: - # name: test-chrome - # browser: chrome - # - test: - # name: test-edge - # browser: edge - # - test: - # name: test-firefox - # browser: firefox + build-test-publish: + jobs: + - test: + name: test-chrome + browser: chrome + - test: + name: test-edge + browser: edge + - test: + name: test-firefox + browser: firefox jobs: test: @@ -43,13 +23,13 @@ jobs: type: string default: "chrome" docker: - - image: cimg/python:<> - - image: selenium/standalone-<>:<> + - image: cimg/python:3.11.7 + - image: selenium/standalone-<>:124.0 environment: - SE_NODE_MAX_SESSIONS: <> - SE_NODE_SESSION_TIMEOUT: <> - SCREEN_WIDTH: <> - SCREEN_HEIGHT: <> + SE_NODE_MAX_SESSIONS: 12 + SE_NODE_SESSION_TIMEOUT: 300 + SCREEN_WIDTH: 1366 + SCREEN_HEIGHT: 768 resource_class: xlarge steps: - setup_remote_docker From 2fa779f711cc13a89c29396a3bf407a0313f2f4f Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Tue, 20 Aug 2024 16:11:01 -0700 Subject: [PATCH 28/53] update package info --- pyproject.toml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8c0b012e..6cedfe83 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,13 +1,13 @@ [tool.poetry] name = "cucu" version = "0.203.0" -license = "MIT" description = "Easy BDD web testing" -authors = ["Domino Data Lab "] readme = "README.md" +license = "The Clear BSD License" +keywords = ["cucumber", "selenium", "behave"] homepage = "https://github.com/dominodatalab/cucu" repository = "https://github.com/dominodatalab/cucu" -keywords = ["cucumber", "selenium"] +authors = ["Domino Data Lab "] classifiers = [ "Development Status :: 4 - Beta", "Environment :: Console", @@ -18,7 +18,6 @@ classifiers = [ "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", From 6b0e6d637628461df4ccc12ab54353ab026081ba Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Tue, 20 Aug 2024 16:11:09 -0700 Subject: [PATCH 29/53] re-enable UI build --- .github/workflows/build.yml | 124 ++++++++++++++++++------------------ 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6eafa1b7..0eee6b78 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,44 +6,8 @@ on: branches: [main] jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - - name: Install depedencies - run: | - pip install poetry - poetry install --no-ansi - - uses: pre-commit/action@v3.0.1 - - API-tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - - name: Install depedencies - run: | - pip install poetry - poetry install --no-ansi - - name: unit tests - run: | - poetry run coverage run -m pytest --junit-xml=results/unit-tests.xml - - # UI-tests: + # lint: # runs-on: ubuntu-latest - - # # container: - # # image: selenium/standalone-chrome:124.0 - # # options: --shm-size=2gb - # # ports: - # # - 4444:4444 - # # env: - # # SE_NODE_MAX_SESSIONS: 12 - # # SE_NODE_SESSION_TIMEOUT: 300 - # # SCREEN_WIDTH: 1366 - # # SCREEN_HEIGHT: 768 - # steps: # - uses: actions/checkout@v4 # - uses: actions/setup-python@v5 @@ -51,33 +15,69 @@ jobs: # run: | # pip install poetry # poetry install --no-ansi + # - uses: pre-commit/action@v3.0.1 - # - name: Install Google Chrome and ChromeDriver + # API-tests: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # - uses: actions/setup-python@v5 + # - name: Install depedencies # run: | - # sudo apt-get update - # sudo apt-get install -y wget - # wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb - # sudo apt install -y ./google-chrome-stable_current_amd64.deb + # pip install poetry + # poetry install --no-ansi + # - name: unit tests + # run: | + # poetry run coverage run -m pytest --junit-xml=results/unit-tests.xml - # wget https://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip - # unzip chromedriver_linux64.zip - # sudo mv chromedriver /usr/local/bin/chromedriver - # sudo chmod +x /usr/local/bin/chromedriver + UI-tests: + runs-on: ubuntu-latest - # # - name: wait_for_selenium - # # # retry connection every 5s x 60 which is a total of 5 minutes - # # run: curl --retry 2 --retry-delay 2 --retry-connrefused http://localhost:4444 + services: + webserver: + image: selenium/standalone-chrome:124.0 + ports: [ 4444:4444 ] + options: --shm-size=2gb + env: + SE_NODE_MAX_SESSIONS: 12 + SE_NODE_SESSION_TIMEOUT: 300 + SCREEN_WIDTH: 1366 + SCREEN_HEIGHT: 768 - # - name: UI tests - # # env: - # # COVERAGE_PROCESS_START: pyproject.toml - # run: | - # poetry run cucu run features/cli/help.feature --workers 1 --generate-report --junit junit_results --browser "chrome" --selenium-remote-url http://localhost:4444 - # env: - # SE_NODE_MAX_SESSIONS: 12 - # SE_NODE_SESSION_TIMEOUT: 300 - # SCREEN_WIDTH: 1366 - # SCREEN_HEIGHT: 768 - # DISPLAY: :99 # Needed for headless mode - # SELENIUM_HOST: localhost - # SELENIUM_PORT: 4444 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + - name: Install depedencies + run: | + pip install poetry + poetry install --no-ansi + + # - name: Install Google Chrome and ChromeDriver + # run: | + # sudo apt-get update + # sudo apt-get install -y wget + # wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb + # sudo apt install -y ./google-chrome-stable_current_amd64.deb + + # wget https://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip + # unzip chromedriver_linux64.zip + # sudo mv chromedriver /usr/local/bin/chromedriver + # sudo chmod +x /usr/local/bin/chromedriver + + - name: wait_for_selenium + # retry connection every 5s x 60 which is a total of 5 minutes + run: curl --retry 10 --retry-delay 2 --retry-connrefused http://localhost:4444 + + - name: UI tests + # env: + # COVERAGE_PROCESS_START: pyproject.toml + run: | + poetry run cucu run features/cli/help.feature --workers 1 --generate-report --junit junit_results --browser "chrome" --selenium-remote-url http://localhost:4444 + env: + SE_NODE_MAX_SESSIONS: 12 + SE_NODE_SESSION_TIMEOUT: 300 + SCREEN_WIDTH: 1366 + SCREEN_HEIGHT: 768 + DISPLAY: :99 # Needed for headless mode + SELENIUM_HOST: localhost + SELENIUM_PORT: 4444 From f76a32525a7a4670f4228298004ac91898f3ce80 Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Tue, 20 Aug 2024 16:13:47 -0700 Subject: [PATCH 30/53] update ports node --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0eee6b78..b2ddfb28 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,7 +36,8 @@ jobs: services: webserver: image: selenium/standalone-chrome:124.0 - ports: [ 4444:4444 ] + ports: + - 4444:4444 options: --shm-size=2gb env: SE_NODE_MAX_SESSIONS: 12 From 6d113c53c01c6978fb1c472921ecdb0297f8b84b Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Tue, 20 Aug 2024 16:14:26 -0700 Subject: [PATCH 31/53] disable circleci --- .circleci/config.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cd56dce1..dbf35c7e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,18 +3,18 @@ --- version: 2.1 -workflows: - build-test-publish: - jobs: - - test: - name: test-chrome - browser: chrome - - test: - name: test-edge - browser: edge - - test: - name: test-firefox - browser: firefox +# workflows: +# build-test-publish: +# jobs: +# - test: +# name: test-chrome +# browser: chrome +# - test: +# name: test-edge +# browser: edge +# - test: +# name: test-firefox +# browser: firefox jobs: test: From 0cc4042a4f7bb54bb7a85ed8a60bdb064e4ab5e4 Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Tue, 20 Aug 2024 16:19:34 -0700 Subject: [PATCH 32/53] save output --- .github/workflows/build.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b2ddfb28..62961182 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -73,7 +73,7 @@ jobs: # env: # COVERAGE_PROCESS_START: pyproject.toml run: | - poetry run cucu run features/cli/help.feature --workers 1 --generate-report --junit junit_results --browser "chrome" --selenium-remote-url http://localhost:4444 + poetry run cucu run features/cli/help.feature --workers 1 --generate-report --report output/report --junit output/junit --browser "chrome" --selenium-remote-url http://localhost:4444 env: SE_NODE_MAX_SESSIONS: 12 SE_NODE_SESSION_TIMEOUT: 300 @@ -82,3 +82,8 @@ jobs: DISPLAY: :99 # Needed for headless mode SELENIUM_HOST: localhost SELENIUM_PORT: 4444 + - name: save output + uses: actions/upload-artifact@v3 + with: + name: build-artifacts + path: output/ From e873efb09d6d4a3dca0f1ed4b95b39093c3b76cb Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Tue, 20 Aug 2024 16:33:10 -0700 Subject: [PATCH 33/53] enable full run --- .github/workflows/build.yml | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 62961182..b0ac7dd0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -52,29 +52,14 @@ jobs: run: | pip install poetry poetry install --no-ansi - - # - name: Install Google Chrome and ChromeDriver - # run: | - # sudo apt-get update - # sudo apt-get install -y wget - # wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb - # sudo apt install -y ./google-chrome-stable_current_amd64.deb - - # wget https://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip - # unzip chromedriver_linux64.zip - # sudo mv chromedriver /usr/local/bin/chromedriver - # sudo chmod +x /usr/local/bin/chromedriver - - name: wait_for_selenium - # retry connection every 5s x 60 which is a total of 5 minutes - run: curl --retry 10 --retry-delay 2 --retry-connrefused http://localhost:4444 - + # retry connection every 2s x 60 which is a total of 2 minutes + run: curl --retry 60 --retry-delay 2 --retry-connrefused http://localhost:4444 - name: UI tests - # env: - # COVERAGE_PROCESS_START: pyproject.toml run: | - poetry run cucu run features/cli/help.feature --workers 1 --generate-report --report output/report --junit output/junit --browser "chrome" --selenium-remote-url http://localhost:4444 + poetry run cucu run features --browser "chrome" --workers 6 --generate-report --report output/report --junit output/junit --selenium-remote-url http://localhost:4444 env: + # COVERAGE_PROCESS_START: pyproject.toml SE_NODE_MAX_SESSIONS: 12 SE_NODE_SESSION_TIMEOUT: 300 SCREEN_WIDTH: 1366 @@ -83,7 +68,7 @@ jobs: SELENIUM_HOST: localhost SELENIUM_PORT: 4444 - name: save output - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: build-artifacts + name: chrome-tests path: output/ From 0d35ee1054a4da05e4239e7f5d70aab1856315c6 Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Tue, 20 Aug 2024 16:59:48 -0700 Subject: [PATCH 34/53] tweaks --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b0ac7dd0..d97f6812 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,6 +48,8 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 + with: + python-version: '3.11' - name: Install depedencies run: | pip install poetry @@ -68,6 +70,7 @@ jobs: SELENIUM_HOST: localhost SELENIUM_PORT: 4444 - name: save output + if: always() uses: actions/upload-artifact@v4 with: name: chrome-tests From d9b1c3db05d5e2f011afd925faf8ff318b0f5173 Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Tue, 20 Aug 2024 17:01:38 -0700 Subject: [PATCH 35/53] limit scope --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d97f6812..e8c80868 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -59,7 +59,7 @@ jobs: run: curl --retry 60 --retry-delay 2 --retry-connrefused http://localhost:4444 - name: UI tests run: | - poetry run cucu run features --browser "chrome" --workers 6 --generate-report --report output/report --junit output/junit --selenium-remote-url http://localhost:4444 + poetry run cucu run features/cli --browser "chrome" --workers 6 --generate-report --report output/report --junit output/junit --selenium-remote-url http://localhost:4444 env: # COVERAGE_PROCESS_START: pyproject.toml SE_NODE_MAX_SESSIONS: 12 From 14bb1271294494271b7a4872dc913e6a8501a790 Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Tue, 20 Aug 2024 17:12:38 -0700 Subject: [PATCH 36/53] add junit test publish and tar up --- .github/workflows/build.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e8c80868..b03b4ef4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,7 +32,11 @@ jobs: UI-tests: runs-on: ubuntu-latest - + permissions: # to publish junit results - see https://github.com/EnricoMi/publish-unit-test-result-action?tab=readme-ov-file#permissions + contents: read + issues: read + checks: write + pull-requests: write services: webserver: image: selenium/standalone-chrome:124.0 @@ -59,7 +63,8 @@ jobs: run: curl --retry 60 --retry-delay 2 --retry-connrefused http://localhost:4444 - name: UI tests run: | - poetry run cucu run features/cli --browser "chrome" --workers 6 --generate-report --report output/report --junit output/junit --selenium-remote-url http://localhost:4444 + poetry run cucu run features/cli/help.feature --browser "chrome" --workers 1 --generate-report --report output/report --junit output/junit --selenium-remote-url http://localhost:4444 + tar cvfz output.tgz output env: # COVERAGE_PROCESS_START: pyproject.toml SE_NODE_MAX_SESSIONS: 12 @@ -74,4 +79,10 @@ jobs: uses: actions/upload-artifact@v4 with: name: chrome-tests - path: output/ + path: output.tgz + - name: Publish Test Results + uses: EnricoMi/publish-unit-test-result-action@v2 + if: always() + with: + files: | + output/junit/**/*.xml From 1836e43b8411c1adea5f43f02933b9efbca36eb3 Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Tue, 20 Aug 2024 17:21:12 -0700 Subject: [PATCH 37/53] enable full with single worker --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b03b4ef4..f30c108f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -63,7 +63,7 @@ jobs: run: curl --retry 60 --retry-delay 2 --retry-connrefused http://localhost:4444 - name: UI tests run: | - poetry run cucu run features/cli/help.feature --browser "chrome" --workers 1 --generate-report --report output/report --junit output/junit --selenium-remote-url http://localhost:4444 + poetry run cucu run features --browser "chrome" --workers 1 --generate-report --report output/report --junit output/junit --selenium-remote-url http://localhost:4444 tar cvfz output.tgz output env: # COVERAGE_PROCESS_START: pyproject.toml From 21caeccfdcf8e3c935ae39b69a5f042b665fb918 Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Tue, 20 Aug 2024 17:23:17 -0700 Subject: [PATCH 38/53] rename run --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f30c108f..42af8d67 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -84,5 +84,6 @@ jobs: uses: EnricoMi/publish-unit-test-result-action@v2 if: always() with: + check_name: "chrome results" files: | output/junit/**/*.xml From c3ba50dca2001648273eebd12674524d7b9deeee Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Wed, 21 Aug 2024 10:37:09 -0700 Subject: [PATCH 39/53] always tar results --- .github/workflows/build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 42af8d67..fc80e845 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -64,7 +64,6 @@ jobs: - name: UI tests run: | poetry run cucu run features --browser "chrome" --workers 1 --generate-report --report output/report --junit output/junit --selenium-remote-url http://localhost:4444 - tar cvfz output.tgz output env: # COVERAGE_PROCESS_START: pyproject.toml SE_NODE_MAX_SESSIONS: 12 @@ -74,6 +73,10 @@ jobs: DISPLAY: :99 # Needed for headless mode SELENIUM_HOST: localhost SELENIUM_PORT: 4444 + - name: tar results + if: always() + run: | + tar cvfz output.tgz output - name: save output if: always() uses: actions/upload-artifact@v4 From 7b22151fd434d698f36f4d08eccbd9d504f0a37e Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Wed, 21 Aug 2024 11:14:18 -0700 Subject: [PATCH 40/53] enable unit tests --- .github/workflows/build.yml | 71 ++++++++++++++++++++++++------------- 1 file changed, 47 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fc80e845..1262788b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,31 +6,52 @@ on: branches: [main] jobs: - # lint: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v4 - # - uses: actions/setup-python@v5 - # - name: Install depedencies - # run: | - # pip install poetry - # poetry install --no-ansi - # - uses: pre-commit/action@v3.0.1 + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + - name: Install depedencies + run: | + pip install poetry + poetry install --no-ansi + - uses: pre-commit/action@v3.0.1 - # API-tests: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v4 - # - uses: actions/setup-python@v5 - # - name: Install depedencies - # run: | - # pip install poetry - # poetry install --no-ansi - # - name: unit tests - # run: | - # poetry run coverage run -m pytest --junit-xml=results/unit-tests.xml + unit-tests: + needs: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + - name: Install depedencies + run: | + pip install poetry + poetry install --no-ansi + - name: unit tests + run: | + poetry run coverage run -m pytest --junit-xml=output/unit-tests.xml + - name: package results + if: always() + run: | + mkdir -p output + mv .coverage.* output/ + tar cvfz output.tgz output + - name: save output + if: always() + uses: actions/upload-artifact@v4 + with: + name: unit-tests + path: output.tgz + - name: Publish Test Results + uses: EnricoMi/publish-unit-test-result-action@v2 + if: always() + with: + check_name: "unit results" + files: | + output/unit-tests.xml - UI-tests: + cucu-tests: + needs: unit-tests runs-on: ubuntu-latest permissions: # to publish junit results - see https://github.com/EnricoMi/publish-unit-test-result-action?tab=readme-ov-file#permissions contents: read @@ -73,9 +94,11 @@ jobs: DISPLAY: :99 # Needed for headless mode SELENIUM_HOST: localhost SELENIUM_PORT: 4444 - - name: tar results + - name: package results if: always() run: | + mkdir -p output + mv .coverage.* output/ tar cvfz output.tgz output - name: save output if: always() From b1867198b7450c75c4649e40a820e7bc18d2b401 Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Wed, 21 Aug 2024 11:16:01 -0700 Subject: [PATCH 41/53] set python version --- .github/workflows/build.yml | 4 ++++ README.md | 2 ++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1262788b..e23c44a1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,6 +11,8 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 + with: + python-version: '3.11' - name: Install depedencies run: | pip install poetry @@ -23,6 +25,8 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 + with: + python-version: '3.11' - name: Install depedencies run: | pip install poetry diff --git a/README.md b/README.md index b94b65c6..f0178897 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ End-to-end testing framework that uses [gherkin](https://cucumber.io/docs/gherkin/) to drive various underlying tools/frameworks to create real world testing scenarios. +[![build](https://github.com/dominodatalab/cucu/actions/workflows/build.yml/badge.svg)](https://github.com/dominodatalab/cucu/actions/workflows/build.yml) + [![CircleCI](https://dl.circleci.com/status-badge/img/gh/dominodatalab/cucu/tree/main.svg?style=svg&circle-token=CCIPRJ_FnyZPtQ9odT5vmGW3CmZNU_bf0cfd776a09729ca4225a2860d9b59c4dae88af)](https://dl.circleci.com/status-badge/redirect/gh/dominodatalab/cucu/tree/main) ## Why cucu? From 4ce34707b12a4ff01f7266ed8d3cff2d9b8c2fe5 Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Wed, 21 Aug 2024 11:17:00 -0700 Subject: [PATCH 42/53] shorten names --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e23c44a1..a9e94704 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ jobs: poetry install --no-ansi - uses: pre-commit/action@v3.0.1 - unit-tests: + unit: needs: lint runs-on: ubuntu-latest steps: @@ -54,8 +54,8 @@ jobs: files: | output/unit-tests.xml - cucu-tests: - needs: unit-tests + cucu: + needs: unit runs-on: ubuntu-latest permissions: # to publish junit results - see https://github.com/EnricoMi/publish-unit-test-result-action?tab=readme-ov-file#permissions contents: read From c48212bc43b920da6bd08e168aef89809c5f61a6 Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Wed, 21 Aug 2024 11:36:05 -0700 Subject: [PATCH 43/53] add matrix option --- .github/workflows/build.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a9e94704..2ffe09ff 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -57,6 +57,9 @@ jobs: cucu: needs: unit runs-on: ubuntu-latest + strategy: + matrix: + browser: ["chrome" ] # , "firefox", "edge"] permissions: # to publish junit results - see https://github.com/EnricoMi/publish-unit-test-result-action?tab=readme-ov-file#permissions contents: read issues: read @@ -64,7 +67,7 @@ jobs: pull-requests: write services: webserver: - image: selenium/standalone-chrome:124.0 + image: selenium/standalone-${{ matrix.browser }}:124.0 ports: - 4444:4444 options: --shm-size=2gb @@ -88,7 +91,7 @@ jobs: run: curl --retry 60 --retry-delay 2 --retry-connrefused http://localhost:4444 - name: UI tests run: | - poetry run cucu run features --browser "chrome" --workers 1 --generate-report --report output/report --junit output/junit --selenium-remote-url http://localhost:4444 + poetry run cucu run features --browser "${{ matrix.browser }}" --workers 1 --generate-report --report output/report --junit output/junit --selenium-remote-url http://localhost:4444 env: # COVERAGE_PROCESS_START: pyproject.toml SE_NODE_MAX_SESSIONS: 12 @@ -108,12 +111,12 @@ jobs: if: always() uses: actions/upload-artifact@v4 with: - name: chrome-tests + name: ${{ matrix.browser }}-tests path: output.tgz - name: Publish Test Results uses: EnricoMi/publish-unit-test-result-action@v2 if: always() with: - check_name: "chrome results" + check_name: "${{ matrix.browser }} results" files: | output/junit/**/*.xml From 994689111ad4a103dd091fdec49436e4ea9cb3f1 Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Wed, 21 Aug 2024 11:37:08 -0700 Subject: [PATCH 44/53] enable coverage --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2ffe09ff..c2792131 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -93,7 +93,7 @@ jobs: run: | poetry run cucu run features --browser "${{ matrix.browser }}" --workers 1 --generate-report --report output/report --junit output/junit --selenium-remote-url http://localhost:4444 env: - # COVERAGE_PROCESS_START: pyproject.toml + COVERAGE_PROCESS_START: pyproject.toml SE_NODE_MAX_SESSIONS: 12 SE_NODE_SESSION_TIMEOUT: 300 SCREEN_WIDTH: 1366 From cb71a3f3f6133bb053499430ff98374be324f7ee Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Wed, 21 Aug 2024 11:42:32 -0700 Subject: [PATCH 45/53] enable firefox and edge --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c2792131..8b1c6fd3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -59,7 +59,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - browser: ["chrome" ] # , "firefox", "edge"] + browser: ["chrome", "firefox", "edge"] permissions: # to publish junit results - see https://github.com/EnricoMi/publish-unit-test-result-action?tab=readme-ov-file#permissions contents: read issues: read From 5651a9fa9240bf3e71d19bf8839d3f10e4363ef4 Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Wed, 21 Aug 2024 12:46:47 -0700 Subject: [PATCH 46/53] increase the shared memory size --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8b1c6fd3..f9cab84a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -70,7 +70,7 @@ jobs: image: selenium/standalone-${{ matrix.browser }}:124.0 ports: - 4444:4444 - options: --shm-size=2gb + options: --shm-size=4gb env: SE_NODE_MAX_SESSIONS: 12 SE_NODE_SESSION_TIMEOUT: 300 From f00ac24b215dbef24d239855b839bf6eafaa23c3 Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Wed, 21 Aug 2024 14:10:58 -0700 Subject: [PATCH 47/53] re-enable CircleCI --- .circleci/config.yml | 60 +++++++++++++++++++++++++++++-------- .github/workflows/build.yml | 7 +++-- 2 files changed, 52 insertions(+), 15 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index dbf35c7e..51970218 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,20 +3,56 @@ --- version: 2.1 -# workflows: -# build-test-publish: -# jobs: -# - test: -# name: test-chrome -# browser: chrome -# - test: -# name: test-edge -# browser: edge -# - test: -# name: test-firefox -# browser: firefox +workflows: + build-test-publish: + jobs: + - pre-commit + - test: + name: test-chrome + browser: chrome + requires: + - pre-commit + - test: + name: test-edge + browser: edge + requires: + - pre-commit + - test: + name: test-firefox + browser: firefox + requires: + - pre-commit jobs: + pre-commit: + docker: + - image: cimg/python:3.11.7 + resource_class: medium + steps: + - checkout + - run: + name: install dependencies + command: | + set +eo pipefail + pip install --upgrade pip + pip install pre-commit + pre-commit install-hooks + - run: + name: install cucu dependencies + command: | + set +eo pipefail + python -m virtualenv --upgrade-embed-wheels + poetry install --no-ansi + - run: + name: build the cucu python package + command: poetry build + - run: + name: install cucu globally + command: pip install dist/cucu-*.tar.gz + - run: + name: run pre-commit validations + command: pre-commit run --show-diff-on-failure --from-ref origin/HEAD --to-ref HEAD + test: parameters: browser: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f9cab84a..30714982 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,9 +1,10 @@ name: build +# This is a beta version of migrating the CircleCI build to GH Actions +# TODO: Figure out and prevent firefox and edge tests getting auto-cancelled (out of memory?) +# TODO: Combine coverage reports in another job on: - pull_request: - push: - branches: [main] + workflow_dispatch: jobs: lint: From f4d64c380ae1ba501c72a0095a701619d09341c1 Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Wed, 21 Aug 2024 14:11:31 -0700 Subject: [PATCH 48/53] add auto publish to test.pypi.org --- .github/workflows/create_a_new_release.yml | 7 ++++++ .github/workflows/publish-test.yml | 29 ++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 .github/workflows/publish-test.yml diff --git a/.github/workflows/create_a_new_release.yml b/.github/workflows/create_a_new_release.yml index e5fdc99e..ed619b20 100644 --- a/.github/workflows/create_a_new_release.yml +++ b/.github/workflows/create_a_new_release.yml @@ -35,3 +35,10 @@ jobs: -F prerelease=false \ -F generate_release_notes=true fi + - name: trigger publish-test workflow + run: | + curl -X POST \ + -H "Authorization: token ${{ github.token }}" \ + -H "Accept: application/vnd.github+json" \ + https://api.github.com/repos/${GITHUB_REPOSITORY}/dispatches \ + -d '{"event_type": "trigger_publish_test"}' diff --git a/.github/workflows/publish-test.yml b/.github/workflows/publish-test.yml new file mode 100644 index 00000000..7c32f3d0 --- /dev/null +++ b/.github/workflows/publish-test.yml @@ -0,0 +1,29 @@ +name: publish-test +# publish to test.pypi.org on merge to default branch + +on: + workflow_dispatch: + repository_dispatch: + types: [trigger_publish_test] + +jobs: + publish-test-main: + environment: cucu-publish-test # match name in test.PyPI.org OIDC + runs-on: ubuntu-latest + permissions: + id-token: write # Required for connecttion to pypi OIDC + steps: + - name: checkout main + uses: actions/checkout@v4 + with: + ref: main + fetch-depth: 0 + - uses: actions/setup-python@v5 # don't use eifinger/setup-rye@v3 since pdm build detects it as dirty + with: + python-version: "3.12" + - name: build package + run: pip install build && python -m build + - name: publish to test.pypi.org + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ From c9dd619843e2b0d2842ce189f0487a55b4fa776d Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Wed, 21 Aug 2024 14:12:58 -0700 Subject: [PATCH 49/53] undo GH Actions badge --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index f0178897..b94b65c6 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,6 @@ End-to-end testing framework that uses [gherkin](https://cucumber.io/docs/gherkin/) to drive various underlying tools/frameworks to create real world testing scenarios. -[![build](https://github.com/dominodatalab/cucu/actions/workflows/build.yml/badge.svg)](https://github.com/dominodatalab/cucu/actions/workflows/build.yml) - [![CircleCI](https://dl.circleci.com/status-badge/img/gh/dominodatalab/cucu/tree/main.svg?style=svg&circle-token=CCIPRJ_FnyZPtQ9odT5vmGW3CmZNU_bf0cfd776a09729ca4225a2860d9b59c4dae88af)](https://dl.circleci.com/status-badge/redirect/gh/dominodatalab/cucu/tree/main) ## Why cucu? From ba8ab3571424f38a15b2ee822f3f4a0b98f590fd Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Wed, 21 Aug 2024 14:22:51 -0700 Subject: [PATCH 50/53] add prod publish --- .github/workflows/publish-production.yml | 30 ++++++++++++++++++++++++ .github/workflows/publish-test.yml | 13 ++++++---- 2 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/publish-production.yml diff --git a/.github/workflows/publish-production.yml b/.github/workflows/publish-production.yml new file mode 100644 index 00000000..c81b0537 --- /dev/null +++ b/.github/workflows/publish-production.yml @@ -0,0 +1,30 @@ +name: publish-production +# publish to test.pypi.org on merge to default branch + +on: + workflow_dispatch: + +jobs: + publish-production-main: + environment: cucu-publish-production # match name in www.PyPI.org OIDC + runs-on: ubuntu-latest + permissions: + id-token: write # Required for connection to pypi OIDC + steps: + - name: checkout main + uses: actions/checkout@v4 + with: + ref: main + fetch-depth: 0 + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + - name: Install depedencies + run: | + pip install poetry + poetry install --no-ansi + - name: build package + run: | + poetry build + - name: publish to test.pypi.org + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/publish-test.yml b/.github/workflows/publish-test.yml index 7c32f3d0..51c4f762 100644 --- a/.github/workflows/publish-test.yml +++ b/.github/workflows/publish-test.yml @@ -11,18 +11,23 @@ jobs: environment: cucu-publish-test # match name in test.PyPI.org OIDC runs-on: ubuntu-latest permissions: - id-token: write # Required for connecttion to pypi OIDC + id-token: write # Required for connection to pypi OIDC steps: - name: checkout main uses: actions/checkout@v4 with: ref: main fetch-depth: 0 - - uses: actions/setup-python@v5 # don't use eifinger/setup-rye@v3 since pdm build detects it as dirty + - uses: actions/setup-python@v5 with: - python-version: "3.12" + python-version: '3.11' + - name: Install depedencies + run: | + pip install poetry + poetry install --no-ansi - name: build package - run: pip install build && python -m build + run: | + poetry build - name: publish to test.pypi.org uses: pypa/gh-action-pypi-publish@release/v1 with: From 8742ad81322ea0e21915d839664f2c9233e18528 Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Wed, 21 Aug 2024 14:38:49 -0700 Subject: [PATCH 51/53] update comment --- .github/workflows/create_a_new_release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/create_a_new_release.yml b/.github/workflows/create_a_new_release.yml index ed619b20..cda0d5cd 100644 --- a/.github/workflows/create_a_new_release.yml +++ b/.github/workflows/create_a_new_release.yml @@ -1,7 +1,8 @@ name: Create a New Release # The following job is run when a commit changes pyproject.toml file: # * Checks if the version of the project is the same of the latest release -# * If not, create a new release +# * If not, create a new release and then start the publishing +# * to test.pypi.org job on: push: From ca3fbbf1780babdcb2c94d06a7ccd54c9bcd1c5e Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Wed, 21 Aug 2024 14:40:31 -0700 Subject: [PATCH 52/53] undo test_core change --- tests/test_core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_core.py b/tests/test_core.py index 1ef51800..6259d333 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -19,7 +19,7 @@ def process_func_to_run_cucu(workers, runtime_timeout): runner = CliRunner() runner.invoke( core.run, - f"data/features/slow_features --runtime-timeout {runtime_timeout} --workers={workers} abc", + f"--runtime-timeout {runtime_timeout} --workers={workers} abc", ) From bec712c6394bbfb063749d33765643e59cec15db Mon Sep 17 00:00:00 2001 From: Cedric Young Date: Wed, 21 Aug 2024 15:11:38 -0700 Subject: [PATCH 53/53] bump version --- CHANGELOG.md | 4 ++++ pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e893446a..e2b6fcb4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project closely adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 0.204.0 +- chore - add gh workflows for publishing +- chore - fix project metadata + ## 0.203.0 - chore - move repo GH org locations - chore - remove sonarqube diff --git a/pyproject.toml b/pyproject.toml index 1b37b596..a7e83a0a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "cucu" -version = "0.203.0" +version = "0.204.0" description = "Easy BDD web testing" readme = "README.md" license = "The Clear BSD License"