From bd3b200ae0a32f9c51b51566ba74c5907d1c6c67 Mon Sep 17 00:00:00 2001 From: robcxyz Date: Sun, 17 Dec 2023 21:07:05 +0700 Subject: [PATCH] chore: move tests so only 3.10 is in main tests --- .github/workflows/codeql.yml | 2 +- .github/workflows/coverage.yml | 2 +- .github/workflows/docs.yml | 3 +- .github/workflows/main-windows.yml | 44 ------------------ .../{main.yml => test-all-platforms.yml} | 22 ++++----- .github/workflows/test.yml | 46 +++++++++++++++++++ .../select/test_prompt_provider_select.py | 3 +- 7 files changed, 63 insertions(+), 59 deletions(-) delete mode 100644 .github/workflows/main-windows.yml rename .github/workflows/{main.yml => test-all-platforms.yml} (80%) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 716d0d033..fead413e5 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -1,4 +1,4 @@ -name: "codeql" +name: codeql on: push: diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 5cdb0d5f1..19fa19b68 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,4 +1,4 @@ -name: coverage-ci +name: coverage on: push: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index c9de22702..2339c0f40 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,4 +1,5 @@ -name: documentation-ci +name: docs + on: push: branches: diff --git a/.github/workflows/main-windows.yml b/.github/workflows/main-windows.yml deleted file mode 100644 index 9595389f4..000000000 --- a/.github/workflows/main-windows.yml +++ /dev/null @@ -1,44 +0,0 @@ -#name: windows-tests -# -#on: -# push: -# branches: -# - main -# tags: -# - "*" -# pull_request: -# branches: -# - "*" -# -#jobs: -# build: -# runs-on: ${{ matrix.os }} -# strategy: -# fail-fast: false -# matrix: -# name: -# - "windows-py310" -# - "windows-py311" -# -# include: -# - name: "windows-py310" -# python: "3.10" -# os: windows-latest -# tox_env: "py310" -# - name: "windows-py311" -# python: "3.11" -# os: windows-latest -# tox_env: "py311" -# -# steps: -# - uses: actions/checkout@v2 -# - name: Set up Python ${{ matrix.python }} -# uses: actions/setup-python@v1 -# with: -# python-version: ${{ matrix.python }} -# - name: Install dependencies -# run: | -# python -m pip install --upgrade pip -# pip install tox virtualenv -# - name: Test build -# run: "tox -e ${{ matrix.tox_env }}" diff --git a/.github/workflows/main.yml b/.github/workflows/test-all-platforms.yml similarity index 80% rename from .github/workflows/main.yml rename to .github/workflows/test-all-platforms.yml index adc561fc1..292715975 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/test-all-platforms.yml @@ -1,4 +1,4 @@ -name: tests +name: test-all-platforms on: push: @@ -17,21 +17,13 @@ jobs: fail-fast: false matrix: name: - - "linting" - - "ubuntu-py310" - "ubuntu-py311" - "macos-py310" - "macos-py311" + - "windows-py310" + - "windows-py311" include: - - name: "linting" - python: "3.10" - os: ubuntu-latest - tox_env: "lint" - - name: "ubuntu-py310" - python: "3.10" - os: ubuntu-latest - tox_env: "py310" - name: "ubuntu-py311" python: "3.11" os: ubuntu-latest @@ -44,6 +36,14 @@ jobs: python: "3.11" os: macos-latest tox_env: "py311" + - name: "windows-py310" + python: "3.10" + os: windows-latest + tox_env: "py310" + - name: "windows-py311" + python: "3.11" + os: windows-latest + tox_env: "py311" steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..c51b4be72 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,46 @@ +name: test + +on: + push: + branches: + - main + tags: + - "*" + pull_request: + branches: + - "*" + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + name: + - "linting" + - "ubuntu-py310" + + include: + - name: "linting" + python: "3.10" + os: ubuntu-latest + tox_env: "lint" + - name: "ubuntu-py310" + python: "3.10" + os: ubuntu-latest + tox_env: "py310" + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install tox virtualenv + - name: Test build + run: "tox -e ${{ matrix.tox_env }}" diff --git a/providers/prompts/tests/select/test_prompt_provider_select.py b/providers/prompts/tests/select/test_prompt_provider_select.py index a988d2ae4..853e5f03e 100644 --- a/providers/prompts/tests/select/test_prompt_provider_select.py +++ b/providers/prompts/tests/select/test_prompt_provider_select.py @@ -2,6 +2,7 @@ from tackle import Context from providers.prompts.hooks.select import InquirerListHook +from tackle.context import Paths, Source @pytest.fixture() @@ -13,7 +14,7 @@ def f(return_value, **kwargs): 'providers.prompts.hooks.select.prompt', return_value=return_value ) - context = Context(key_path=[]) + context = Context(key_path=[], path=Paths(current=Source(file=''))) hook = InquirerListHook(**kwargs) output = hook.exec(context=context)