Skip to content

Add CI configuration and update requirements for testing tools#82

Open
whatislavx wants to merge 1 commit into
mate-academy:mainfrom
whatislavx:develop
Open

Add CI configuration and update requirements for testing tools#82
whatislavx wants to merge 1 commit into
mate-academy:mainfrom
whatislavx:develop

Conversation

@whatislavx

Copy link
Copy Markdown

No description provided.

Copilot AI review requested due to automatic review settings January 23, 2026 19:00

@mateacademy-ai-mentor mateacademy-ai-mentor 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.

Review Summary

Excellent work on the GitHub Actions workflow! Your implementation successfully meets all the functional and technical requirements of the task. I am approving this pull request.

As a minor suggestion for improvement, you can make the workflow more efficient by removing the redundant Run tests step in .github/ci.yml. The Generate and display coverage report step already runs the full test suite, so the initial test run is not needed. This is just an optimization and doesn't affect the correctness of your solution.

Great job!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

Comment thread .github/ci.yml
Comment on lines +41 to +42
- name: Run tests
run: 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.

This step to run tests is redundant. The next step, 'Generate and display coverage report', already runs the full test suite using pytest. You can remove this step to make the workflow more efficient and avoid running all the tests twice.

Copilot AI 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.

Pull request overview

This PR introduces a Python CI workflow and a dev requirements file intended to support automated linting, complexity checks, tests, and coverage reporting.

Changes:

  • Added requirements-dev.txt with pinned versions of pytest/coverage tooling and flake8.
  • Added a GitHub Actions CI workflow to install dependencies, run flake8 checks, run tests, generate coverage, and upload an artifact.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
requirements-dev.txt Introduces dev/test dependencies for CI and local development.
.github/ci.yml Adds a CI workflow definition intended to run linting, tests, and coverage in GitHub Actions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/ci.yml
Comment on lines +1 to +2
name: Python CI
run-name: User ${{ github.actor }} - Commit ${{ github.sha }}

Copilot AI Jan 23, 2026

Copy link

Choose a reason for hiding this comment

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

GitHub Actions only runs workflows from .github/workflows/*.yml. With this file located at .github/ci.yml, the workflow will never trigger. Move/rename it to something like .github/workflows/ci.yml.

Copilot uses AI. Check for mistakes.
Comment thread .github/ci.yml
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r requirements-dev.txt

Copilot AI Jan 23, 2026

Copy link

Choose a reason for hiding this comment

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

This step installs -r requirements.txt, but the repo doesn’t have a root requirements.txt (dependencies live in src/requirements.txt). Update the install command to reference the correct requirements file (or add the missing root requirements file).

Suggested change
pip install -r requirements.txt -r requirements-dev.txt
pip install -r src/requirements.txt -r requirements-dev.txt

Copilot uses AI. Check for mistakes.
Comment thread .github/ci.yml
Comment on lines +42 to +45
run: pytest

- name: Generate and display coverage report
run: pytest --cov=. --cov-report=term-missing

Copilot AI Jan 23, 2026

Copy link

Choose a reason for hiding this comment

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

Running pytest from the repo root is unlikely to work for this project layout: the Django app and tests live under src/ (e.g., tests import accounts.*), so imports will fail unless src is on PYTHONPATH/installed, and Django settings aren’t configured. Consider running tests via python manage.py test from src/, or add pytest-django plus the needed DJANGO_SETTINGS_MODULE and Python path configuration.

Suggested change
run: pytest
- name: Generate and display coverage report
run: pytest --cov=. --cov-report=term-missing
run: pytest
working-directory: ./src
- name: Generate and display coverage report
run: pytest --cov=. --cov-report=term-missing
working-directory: ./src

Copilot uses AI. Check for mistakes.
Comment thread .github/ci.yml
Comment on lines +42 to +45
run: pytest

- name: Generate and display coverage report
run: pytest --cov=. --cov-report=term-missing

Copilot AI Jan 23, 2026

Copy link

Choose a reason for hiding this comment

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

Tests are executed twice (once in “Run tests”, again in the coverage step), which increases CI time and can lead to inconsistent results if tests are order-dependent. Consider running tests only once while collecting coverage, and keep a separate step just to display/report coverage output.

Suggested change
run: pytest
- name: Generate and display coverage report
run: pytest --cov=. --cov-report=term-missing
run: pytest --cov=. --cov-report=term-missing
- name: Generate and display coverage report
run: coverage report -m

Copilot uses AI. Check for mistakes.
Comment thread .github/ci.yml
Comment on lines +47 to +51
- name: Upload Python code as artifact
uses: actions/upload-artifact@v4
with:
name: python-src-code
path: . No newline at end of file

Copilot AI Jan 23, 2026

Copy link

Choose a reason for hiding this comment

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

Uploading the artifact with path: . will include everything in the workspace (including .git, CI metadata, and any large/non-source files), which can bloat artifacts and potentially capture unintended content. Limit the artifact to the Python source tree (e.g., src/**.py, plus any needed templates/static files) or explicitly exclude .git and other non-source paths.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants