Skip to content

Commit 5c9745b

Browse files
mayastor-borstiagolobocastro
mayastor-bors
andcommitted
Merge #1811
1811: Rename action and add ci-report r=tiagolobocastro a=tiagolobocastro ci(gha): upload test report Add test script which generates a report tar with useful information such as journalctl logs and nvme devices. Upload this tar on github actions. --- ci: rename push job The previous name was image-build-test which clashed with the image build test :) Co-authored-by: Tiago Castro <tiagolobocastro@gmail.com>
2 parents 9f6db63 + 2179da1 commit 5c9745b

File tree

5 files changed

+49
-7
lines changed

5 files changed

+49
-7
lines changed

.github/workflows/bdd.yml

+14-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
- name: Setup Test Pre-Requisites
3030
run: |
3131
sudo sysctl -w vm.nr_hugepages=2560
32+
sudo apt-get update
3233
sudo apt-get install linux-modules-extra-$(uname -r)
3334
for module in nvme_tcp nbd nvme_rdma; do
3435
sudo modprobe $module
@@ -41,7 +42,7 @@ jobs:
4142
run: |
4243
echo "TEST_START_DATE=$(date +"%Y-%m-%d %H:%M:%S")" >> $GITHUB_ENV
4344
nix-shell --run "./scripts/pytest-tests.sh"
44-
- name: Test Report
45+
- name: Pytest BDD Report
4546
if: always()
4647
uses: pmeier/pytest-results-action@main
4748
with:
@@ -50,6 +51,18 @@ jobs:
5051
display-options: a
5152
fail-on-empty: true
5253
title: Test results
54+
- run: |
55+
if [ -d test/python/reports ]; then
56+
mkdir -p ci-report
57+
mv test/python/reports ci-report/python
58+
fi
59+
nix-shell --run "./scripts/ci-report.sh"
60+
if: failure()
61+
- uses: actions/upload-artifact@v4
62+
if: failure()
63+
with:
64+
name: ci-report-bdd
65+
path: ./ci-report/ci-report.tar.gz
5366
- name: Cleanup
5467
if: always()
5568
run: nix-shell --run "./scripts/pytest-tests.sh --clean-all-exit"

.github/workflows/image.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ env:
1313
CI: 1
1414

1515
jobs:
16-
image-build-test:
16+
image-build-push:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- uses: actions/checkout@v4

.github/workflows/unit-int.yml

+13-5
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
- name: Setup Test Pre-Requisites
3232
run: |
3333
sudo sysctl -w vm.nr_hugepages=3584
34+
sudo apt-get update
3435
sudo apt-get install linux-modules-extra-$(uname -r)
3536
for module in nvme_tcp nbd nvme_rdma; do
3637
sudo modprobe $module
@@ -49,21 +50,28 @@ jobs:
4950
run: |
5051
echo "TEST_START_DATE=$(date +"%Y-%m-%d %H:%M:%S")" >> $GITHUB_ENV
5152
nix-shell --run "./scripts/grpc-test.sh"
52-
mkdir js-reports
53+
mkdir -p ci-report/js
5354
for file in *-xunit-report.xml; do
54-
echo "<testsuites>" > "js-reports/$file"
55-
cat $file >> "js-reports/$file"
56-
echo "</testsuites>" >> "js-reports/$file"
55+
echo "<testsuites>" > "ci-report/js/$file"
56+
cat $file >> "ci-report/js/$file"
57+
echo "</testsuites>" >> "ci-report/js/$file"
5758
done
5859
- name: Test Report
5960
if: always()
6061
uses: pmeier/pytest-results-action@main
6162
with:
62-
path: 'js-reports/*-xunit-report.xml'
63+
path: 'ci-report/js/*-xunit-report.xml'
6364
summary: true
6465
display-options: a
6566
fail-on-empty: true
6667
title: Test results
68+
- run: nix-shell --run "./scripts/ci-report.sh"
69+
if: failure()
70+
- uses: actions/upload-artifact@v4
71+
if: failure()
72+
with:
73+
name: ci-report-int
74+
path: ./ci-report/ci-report.tar.gz
6775
- name: Cleanup
6876
if: always()
6977
run: nix-shell --run "./scripts/clean-cargo-tests.sh"

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,4 @@ ansible-hosts
4444
/*-xunit-report.xml
4545
/rust-toolchain.toml
4646
/test/python/reports
47+
/ci-report/

scripts/ci-report.sh

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
3+
SCRIPT_DIR="$(dirname "$0")"
4+
export ROOT_DIR="$SCRIPT_DIR/.."
5+
SUDO=$(which sudo)
6+
CI_REPORT_START_DATE=${CI_REPORT_START_DATE:--3h}
7+
8+
set -eu
9+
10+
mkdir -p "$ROOT_DIR/ci-report"
11+
cd "$ROOT_DIR/ci-report"
12+
13+
journalctl --since="$CI_REPORT_START_DATE" -o short-precise > journalctl.txt
14+
journalctl -k -b0 -o short-precise > dmesg.txt
15+
lsblk -tfa > lsblk.txt
16+
$SUDO nvme list -v > nvme.txt
17+
$SUDO nvme list-subsys -v >> nvme.txt
18+
cat /proc/meminfo > meminfo.txt
19+
20+
find . -type f \( -name "*.txt" -o -name "*.xml" \) -print0 | xargs -0 tar -czvf ci-report.tar.gz

0 commit comments

Comments
 (0)