Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Followup fixes to new test suite/CI #30

Merged
merged 1 commit into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/test-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2 # coverage: Issue detecting commit SHA
# We need the full history for update tests
fetch-depth: 0
fetch-tags: true

- name: Set up Python 3.12
uses: actions/setup-python@v5
Expand All @@ -29,13 +31,13 @@ jobs:

- name: Install Test Requirements
run: |
nox --force-color -e tests-3 --install-only
nox --force-color -e tests --install-only

- name: Test
env:
SKIP_REQUIREMENTS_INSTALL: true
run: |
nox --force-color -e tests-3 -- -vv tests/
nox --force-color -e tests -- -vv tests/

# - name: Create CodeCov Flags
# if: always()
Expand Down
5 changes: 4 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,12 @@ def project(answers, request, copie):
yield res.project_dir


@pytest.fixture
def project_committed(project):
with local.cwd(project):
git = local["git"]["-c", "commit.gpgsign=false"]
git = local["git"][
"-c", "commit.gpgsign=false", "-c", "user.name=foobar", "-c", "[email protected]"
]
git("init")
git("add", ".")
git("commit", "-m", "initial commit")
Expand Down
6 changes: 4 additions & 2 deletions tests/test_basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ def test_update_from_002_works(copie, project):


def _commit_with_pre_commit(venv, max_retry=3, message="initial commit"):
git = local["git"]["-c", "commit.gpgsign=false"]
venv.run("pre-commit", "install")
git = local["git"][
"-c", "commit.gpgsign=false", "-c", "user.name=foobar", "-c", "[email protected]"
]
venv.run(venv.venv_python, "-m", "pre_commit", "install")
retry_count = 1
saved_err = None

Expand Down