From d1bac1ca0d7d3be07e86a92a144d383b688d5918 Mon Sep 17 00:00:00 2001 From: Marc Garcia Date: Wed, 27 Nov 2019 23:29:34 +0000 Subject: [PATCH 1/5] CI: Making benchmark errors easier to find --- .github/workflows/ci.yml | 15 +++++++++++---- asv_bench/benchmarks/plotting.py | 1 + 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b689da8e39ff0..694a576780a29 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,10 +80,10 @@ jobs: git fetch upstream if git diff upstream/master --name-only | grep -q "^asv_bench/"; then asv machine --yes - ASV_OUTPUT="$(asv dev)" - if [[ $(echo "$ASV_OUTPUT" | grep "failed") ]]; then - echo "##vso[task.logissue type=error]Benchmarks run with errors" - echo "$ASV_OUTPUT" + asv dev | sed "/failed$/ s/^/##[error]/" > benchmarks.log + if grep "failed" benchmarks.log; then + cat benchmarks.log + echo "##[error]Benchmarks run with errors" exit 1 else echo "Benchmarks run without errors" @@ -92,3 +92,10 @@ jobs: echo "Benchmarks did not run, no changes detected" fi if: true + + - name: Publish benchmarks artifact + uses: actions/upload-artifact@master + with: + name: Benchmarks log + path: benchmarks.json + if: failure() diff --git a/asv_bench/benchmarks/plotting.py b/asv_bench/benchmarks/plotting.py index 5c718516360ed..390aed9a1c4da 100644 --- a/asv_bench/benchmarks/plotting.py +++ b/asv_bench/benchmarks/plotting.py @@ -80,6 +80,7 @@ def time_plot_irregular(self): self.df2.plot() def time_plot_table(self): + raise RuntimeError("Seeing how the changes in the CI look like") self.df.plot(table=True) From 2f8e08c0ec12731b43450dae73ab86c70ccd41ad Mon Sep 17 00:00:00 2001 From: Marc Garcia Date: Thu, 28 Nov 2019 00:30:51 +0000 Subject: [PATCH 2/5] Clearer output of benchmarks run --- .github/workflows/ci.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 694a576780a29..6e9f0da6ea26b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,13 +80,9 @@ jobs: git fetch upstream if git diff upstream/master --name-only | grep -q "^asv_bench/"; then asv machine --yes - asv dev | sed "/failed$/ s/^/##[error]/" > benchmarks.log - if grep "failed" benchmarks.log; then - cat benchmarks.log - echo "##[error]Benchmarks run with errors" + asv dev | sed "/failed$/ s/^/##[error]/" | tee benchmarks.log + if grep "^##[error]" benchmarks.log; then exit 1 - else - echo "Benchmarks run without errors" fi else echo "Benchmarks did not run, no changes detected" @@ -97,5 +93,5 @@ jobs: uses: actions/upload-artifact@master with: name: Benchmarks log - path: benchmarks.json + path: asv_bench/benchmarks.log if: failure() From 3056677512e30a71eae3fac5e4a86af23c36c93f Mon Sep 17 00:00:00 2001 From: Marc Garcia Date: Thu, 28 Nov 2019 10:58:42 +0000 Subject: [PATCH 3/5] Fixing condition to fail benchmarks step --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e9f0da6ea26b..9d9edbd5703ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,7 +81,7 @@ jobs: if git diff upstream/master --name-only | grep -q "^asv_bench/"; then asv machine --yes asv dev | sed "/failed$/ s/^/##[error]/" | tee benchmarks.log - if grep "^##[error]" benchmarks.log; then + if grep "failed" benchmarks.log; then exit 1 fi else From 0e393190769df01ff50602bc8e7bc1dbcfefc1a5 Mon Sep 17 00:00:00 2001 From: Marc Garcia Date: Thu, 28 Nov 2019 11:44:41 +0000 Subject: [PATCH 4/5] Avoid repeating the failing lines --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9d9edbd5703ee..f68080d05bea6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,7 +81,7 @@ jobs: if git diff upstream/master --name-only | grep -q "^asv_bench/"; then asv machine --yes asv dev | sed "/failed$/ s/^/##[error]/" | tee benchmarks.log - if grep "failed" benchmarks.log; then + if grep "failed" benchmarks.log > /dev/null ; then exit 1 fi else From c77bccb2f2b92dd4989406b203d0ff33d75a07c6 Mon Sep 17 00:00:00 2001 From: Marc Garcia Date: Thu, 28 Nov 2019 16:17:41 +0000 Subject: [PATCH 5/5] Removing raise in benchmark --- asv_bench/benchmarks/plotting.py | 1 - 1 file changed, 1 deletion(-) diff --git a/asv_bench/benchmarks/plotting.py b/asv_bench/benchmarks/plotting.py index 390aed9a1c4da..5c718516360ed 100644 --- a/asv_bench/benchmarks/plotting.py +++ b/asv_bench/benchmarks/plotting.py @@ -80,7 +80,6 @@ def time_plot_irregular(self): self.df2.plot() def time_plot_table(self): - raise RuntimeError("Seeing how the changes in the CI look like") self.df.plot(table=True)