Skip to content

aurimrv/IdentifierPy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IdentifierPy

Sample program to teach software testing concepts.

Pre-requirements

Create virtual environment

pyenv virtualenv mlp-esbd
pyenv activate mlp-esbd
cd IdentifierPy
pip install -r requirements.txt
pip install -e .

Running IdentifierMain.py

python src/IdentifierMain.py abc

Running test_validate.py

python -m pytest -v tests/src/test_validate.py
pytest -v tests/src/test_validate.py

Creating a distribution package

pyinstaller --onefile src/IdentifierMain.py

Measuring Coverage

coverage run --source=src.Identifier -m pytest tests
coverage run --source=src.Identifier --branch -m pytest tests
coverage report
coverage html -d coverage

It is also possible to configure a .coveragerc file

[run]
source = src
branch = True
omit = */tests/*
coverage run --omit='*/tests/*' --branch -m pytest

Coverage in GitHub Actions

      # Run pytest with coverage (fail if coverage < 80%). Include "--cov-branch \" below to use branch coverage
      - name: Run tests with coverage  
        run: |
          pytest --cov=./ \
                --cov-report=xml \
                --cov-fail-under=60 \
                test_pipeline.py

      - name: Upload to Codecov
        if: success()  # Only run if previous steps succeed
        uses: codecov/codecov-action@v3
        with:
          token: ${{ secrets.CODECOV_TOKEN }}  # Uses the secret
          file: ./coverage.xml  # Explicit path to coverage file
          flags: github-actions  # Optional: tag this upload
          override_commit: ${{ github.event.pull_request.head.sha }}
          override_branch: ${{ github.event.pull_request.head.ref }}

Run Mutation Tool

Berofe run this tool, make sure to install requirements.txt dependencies.

mut.py -t src/Identifier.py -u tests/test_validate.py --runner pytest --report-html mutpy

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published