Skip to content

ci: install pytest in GitHub test workflow - #2

Merged
developerashkan merged 2 commits into
mainfrom
codex/fix-failing-job-due-to-missing-pytest
Feb 5, 2026
Merged

developerashkan merged 2 commits into
mainfrom
codex/fix-failing-job-due-to-missing-pytest

Conversation

@developerashkan

Copy link
Copy Markdown
Owner

Motivation

  • CI jobs 62672078724 and 62672078795 were failing because the runner invoked python -m pytest but pytest was not installed in the workflow environment.
  • Install pytest (and optionally other test deps) in the workflow to ensure tests can run reliably.

Description

  • Add a new GitHub Actions workflow at .github/workflows/tests.yml that runs on push and pull_request.
  • Configure a test job that uses ubuntu-latest and sets up Python 3.11 with actions/setup-python@v5.
  • Add an Install dependencies step that upgrades pip and installs pytest (python -m pip install --upgrade pip and pip install pytest).
  • Run tests with python -m pytest in a separate Run tests step.

Testing

  • Verified the workflow file content by inspecting .github/workflows/tests.yml and confirmed it contains the install and run steps as intended, which succeeded.
  • Ran git diff --check and git status --short locally, both succeeded with no issues detected.
  • No CI run was executed in this environment; the workflow now ensures future GitHub Actions runs will install pytest before test execution.

Codex Task

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b8f268cf7e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

pip install pytest

- name: Run tests
run: python -m pytest

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Prevent workflow from failing when no tests exist

This job unconditionally runs python -m pytest, but in the current repository there are no Python test files, so pytest exits with code 5 (no tests ran) and the workflow fails on every push/PR even when nothing is wrong with the code. I verified this against the repo contents (no test*.py files) and by reproducing pytest’s behavior in an empty directory, so the new workflow as written is self-failing until tests are added or the command is made tolerant of empty suites.

Useful? React with 👍 / 👎.

@developerashkan
developerashkan merged commit 6d68f95 into main Feb 5, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant