Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create pytest output artifact [ci] #98106

Merged
merged 1 commit into from
Aug 14, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
41 changes: 37 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -734,9 +734,12 @@ jobs:
- name: Run pytest (fully)
if: needs.info.outputs.test_full_suite == 'true'
timeout-minutes: 60
id: pytest-full
run: |
. venv/bin/activate
python --version
set -o pipefail

python3 -X dev -m pytest \
-qq \
--timeout=9 \
Expand All @@ -749,14 +752,17 @@ jobs:
--cov-report=xml \
-o console_output_style=count \
-p no:sugar \
tests
tests \
2>&1 | tee pytest-${{ matrix.python-version }}-${{ matrix.group }}.txt
- name: Run pytest (partially)
if: needs.info.outputs.test_full_suite == 'false'
timeout-minutes: 10
id: pytest-partial
shell: bash
run: |
. venv/bin/activate
python --version
set -o pipefail

if [[ ! -f "tests/components/${{ matrix.group }}/__init__.py" ]]; then
echo "::error:: missing file tests/components/${{ matrix.group }}/__init__.py"
Expand All @@ -774,7 +780,14 @@ jobs:
--durations=0 \
--durations-min=1 \
-p no:sugar \
tests/components/${{ matrix.group }}
tests/components/${{ matrix.group }} \
2>&1 | tee pytest-${{ matrix.python-version }}-${{ matrix.group }}.txt
- name: Upload pytest output
if: success() || failure() && (steps.pytest-full.conclusion == 'failure' || steps.pytest-partial.conclusion == 'failure')
uses: actions/upload-artifact@v3.1.2
with:
name: pytest-${{ github.run_number }}
path: pytest-*.txt
- name: Upload coverage artifact
uses: actions/upload-artifact@v3.1.2
with:
Expand Down Expand Up @@ -862,10 +875,13 @@ jobs:
python3 -m script.translations develop --all
- name: Run pytest (partially)
timeout-minutes: 20
id: pytest-partial
shell: bash
run: |
. venv/bin/activate
python --version
set -o pipefail
mariadb=$(echo "${{ matrix.mariadb-group }}" | sed "s/:/-/g")

python3 -X dev -m pytest \
-qq \
Expand All @@ -881,7 +897,14 @@ jobs:
tests/components/history \
tests/components/logbook \
tests/components/recorder \
tests/components/sensor
tests/components/sensor \
2>&1 | tee pytest-${{ matrix.python-version }}-${mariadb}.txt
- name: Upload pytest output
if: success() || failure() && steps.pytest-partial.conclusion == 'failure'
uses: actions/upload-artifact@v3.1.2
with:
name: pytest-${{ github.run_number }}
path: pytest-*.txt
- name: Upload coverage artifact
uses: actions/upload-artifact@v3.1.2
with:
Expand Down Expand Up @@ -969,10 +992,13 @@ jobs:
python3 -m script.translations develop --all
- name: Run pytest (partially)
timeout-minutes: 20
id: pytest-partial
shell: bash
run: |
. venv/bin/activate
python --version
set -o pipefail
postgresql=$(echo "${{ matrix.postgresql-group }}" | sed "s/:/-/g")

python3 -X dev -m pytest \
-qq \
Expand All @@ -989,7 +1015,14 @@ jobs:
tests/components/history \
tests/components/logbook \
tests/components/recorder \
tests/components/sensor
tests/components/sensor \
2>&1 | tee pytest-${{ matrix.python-version }}-${postgresql}.txt
- name: Upload pytest output
if: success() || failure() && steps.pytest-partial.conclusion == 'failure'
uses: actions/upload-artifact@v3.1.2
with:
name: pytest-${{ github.run_number }}
path: pytest-*.txt
- name: Upload coverage artifact
uses: actions/upload-artifact@v3.1.0
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ htmlcov/
test-reports/
test-results.xml
test-output.xml
pytest-*.txt

# Translations
*.mo
Expand Down