Skip to content

Commit

Permalink
Add workflow and requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
d-rede committed Sep 12, 2023
1 parent 6fb634b commit 81555f1
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This workflow will install the trcli package and run e2e tests

name: e2e-tests

on:
workflow_dispatch:

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r tests_e2e/requirements.txt
- name: Test with pytest
run: |
coverage run -m pytest \
-c ./tests_e2e/pytest.ini \
-W ignore::pytest.PytestCollectionWarning \
--md-report --md-report-output=report.md --md-report-color=never \
tests_e2e || pytest_exit_code=$?
echo "## :clipboard: Test Results" >> $GITHUB_STEP_SUMMARY
cat report.md >> $GITHUB_STEP_SUMMARY
echo "## :bar_chart: Code coverage" >> $GITHUB_STEP_SUMMARY
coverage report --format markdown >> $GITHUB_STEP_SUMMARY
if [[ $pytest_exit_code -gt 0 ]]
then
echo "::error::Unit tests failed" && exit_code=1
fi
exit $exit_code
3 changes: 3 additions & 0 deletions tests_e2e/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pytest
pytest-md-report
coverage

0 comments on commit 81555f1

Please sign in to comment.