Skip to content
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
1 change: 0 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@
### Notes:
- @Goraved should be added to the assignees;
- Tests should be passed;
- Linter should be passed.
23 changes: 0 additions & 23 deletions .github/workflows/pylint.yml

This file was deleted.

7 changes: 4 additions & 3 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.8 ]
python-version: [ 3.12 ]

steps:
- uses: actions/checkout@v2
Expand All @@ -18,13 +18,14 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f requirements.txt ]; then uv pip install -r requirements.txt --upgrade --system; fi
- name: Install browsers
run: python -m playwright install
- name: Test with pytest
env:
GITHUB_RUN: True
run: |
pytest
pytest tests
54 changes: 54 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.0
hooks:
# Run the linter.
- id: ruff
args: [ --fix ]

- repo: local
hooks:
- id: code-smell-check
name: Check code smells in pytest tests
entry: bash
language: system
pass_filenames: false
args:
- "-c"
- |
# Run analysis
output=$(python utils/code_smells.py --dir=tests)

echo "$output"

percentage=$(echo "$output" | grep "Percentage of 'smelly' tests: " | awk '{print $5}' | sed 's/%//')

# Check if percentage is numeric
if ! [[ "$percentage" =~ ^[0-9]+(\.[0-9]+)?$ ]]; then
echo "Failed to determine the percentage of 'smelly' tests. Make sure the output contains the expected line."
exit 1
fi

# Now safely compare - if percentage is 50% or higher, block the commit
result=$(echo "$percentage >= 50" | bc)
if [ "$result" -eq 1 ]; then
echo "Too many 'smelly' tests (${percentage}%). Commit blocked!"
exit 1
else
echo "Acceptable level of 'smelly' tests (${percentage}%). Commit allowed."
fi

always_run: true
verbose: true

- id: framework-unit-tests
name: Run framework unit tests
entry: pytest
language: system
pass_filenames: false
args: [
"-m unit",
"-v"
]
always_run: true
verbose: true
8 changes: 0 additions & 8 deletions .pylintrc

This file was deleted.

49 changes: 0 additions & 49 deletions Dockerfile

This file was deleted.

Loading