From da246380794894e704c60b59fc3010c690135dfd Mon Sep 17 00:00:00 2001 From: EdwardLi-coder <2023edwardll@gmail.com> Date: Sat, 10 Aug 2024 22:04:17 +0800 Subject: [PATCH 1/7] update artifact v3 to v4 --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 03d98ef5e8..c9d616ec0e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -216,7 +216,7 @@ jobs: - name: Archive failed tests screenshots if: failure() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: failed-tests-screenshots path: tmp/capybara/screenshots/*.png @@ -294,7 +294,7 @@ jobs: - name: Archive failed tests screenshots if: failure() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: failed-tests-screenshots path: tmp/capybara/screenshots/*.png @@ -373,7 +373,7 @@ jobs: - name: Archive failed tests screenshots if: failure() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: failed-tests-screenshots path: tmp/capybara/screenshots/*.png From be13d43e0cbb0398620e22ab445089c64ee6bc1c Mon Sep 17 00:00:00 2001 From: EdwardLi-coder <2023edwardll@gmail.com> Date: Sun, 11 Aug 2024 00:20:18 +0800 Subject: [PATCH 2/7] delete Archive failed tests screenshots --- .github/workflows/build.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c9d616ec0e..5ca5ebb543 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -371,15 +371,6 @@ jobs: run: | bin/rake knapsack_pro:rspec - - name: Archive failed tests screenshots - if: failure() - uses: actions/upload-artifact@v4 - with: - name: failed-tests-screenshots - path: tmp/capybara/screenshots/*.png - retention-days: 7 - if-no-files-found: ignore - test_the_rest: runs-on: ubuntu-22.04 services: From 9fe128d494e5addbc3bce39fbb328ea7cc4d13aa Mon Sep 17 00:00:00 2001 From: EdwardLi-coder <2023edwardll@gmail.com> Date: Mon, 12 Aug 2024 16:04:22 +0800 Subject: [PATCH 3/7] add fail test --- spec/system/admin/products_v3/update_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/system/admin/products_v3/update_spec.rb b/spec/system/admin/products_v3/update_spec.rb index fec4236177..8537103d09 100644 --- a/spec/system/admin/products_v3/update_spec.rb +++ b/spec/system/admin/products_v3/update_spec.rb @@ -682,6 +682,12 @@ RSpec.describe 'As an enterprise user, I can update my products' do end end + it "fails intentionally to generate screenshot" do + within ".reveal-modal" do + expect(page).to have_content "This text does not exist" + end + end + it 'shows a modal telling not a valid image when uploading a non valid image file' do within ".reveal-modal" do attach_file 'image[attachment]', From 83bf19084b3959e4e276b6617d5c09553f68d597 Mon Sep 17 00:00:00 2001 From: EdwardLi-coder <2023edwardll@gmail.com> Date: Mon, 12 Aug 2024 16:29:52 +0800 Subject: [PATCH 4/7] remove fail test --- spec/system/admin/products_v3/update_spec.rb | 6 ------ 1 file changed, 6 deletions(-) diff --git a/spec/system/admin/products_v3/update_spec.rb b/spec/system/admin/products_v3/update_spec.rb index 8537103d09..fec4236177 100644 --- a/spec/system/admin/products_v3/update_spec.rb +++ b/spec/system/admin/products_v3/update_spec.rb @@ -682,12 +682,6 @@ RSpec.describe 'As an enterprise user, I can update my products' do end end - it "fails intentionally to generate screenshot" do - within ".reveal-modal" do - expect(page).to have_content "This text does not exist" - end - end - it 'shows a modal telling not a valid image when uploading a non valid image file' do within ".reveal-modal" do attach_file 'image[attachment]', From 8a2be468fc2e22abd4db2a4180b770779118b6b1 Mon Sep 17 00:00:00 2001 From: Ahmed Ejaz Date: Tue, 13 Aug 2024 00:22:10 +0500 Subject: [PATCH 5/7] test artifact upload from different nodes at the same time --- spec/system/admin/order_spec.rb | 1 + spec/system/consumer/account_spec.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/spec/system/admin/order_spec.rb b/spec/system/admin/order_spec.rb index 90c5028f39..2525d76387 100644 --- a/spec/system/admin/order_spec.rb +++ b/spec/system/admin/order_spec.rb @@ -100,6 +100,7 @@ RSpec.describe ' it 'shows error when order cycle is not selected' do select2_select distributor.name, from: 'order_distributor_id' click_button 'Next' + raise 'Testing artifact upload from different nodes at the same time' expect(page).to have_content "Order cycle can't be blank" end diff --git a/spec/system/consumer/account_spec.rb b/spec/system/consumer/account_spec.rb index ed984f3452..3d72fad016 100644 --- a/spec/system/consumer/account_spec.rb +++ b/spec/system/consumer/account_spec.rb @@ -92,6 +92,7 @@ RSpec.describe ' it "shows such orders in a section labelled 'Open Orders'" do visit '/account' expect(page).to have_content 'Open Orders' + raise 'Testing artifact upload from different nodes at the same time' expect(page).to have_link 'Edit', href: order_path(d1o1) expect(page).to have_link 'Edit', href: order_path(d1o2) From 734aebbaaaf94abdaf3ffc2e53a0b0e37e24d4c0 Mon Sep 17 00:00:00 2001 From: Ahmed Ejaz Date: Tue, 13 Aug 2024 00:42:59 +0500 Subject: [PATCH 6/7] update uploaded artifact names to be different --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5ca5ebb543..c5c7ba16f8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -218,7 +218,7 @@ jobs: if: failure() uses: actions/upload-artifact@v4 with: - name: failed-tests-screenshots + name: failed-admin-tests-screenshots path: tmp/capybara/screenshots/*.png retention-days: 7 if-no-files-found: ignore @@ -296,7 +296,7 @@ jobs: if: failure() uses: actions/upload-artifact@v4 with: - name: failed-tests-screenshots + name: failed-consumer-tests-screenshots path: tmp/capybara/screenshots/*.png retention-days: 7 if-no-files-found: ignore From 64568f4aa4c492e1e7dfe101923c89378391c5de Mon Sep 17 00:00:00 2001 From: Ahmed Ejaz Date: Tue, 13 Aug 2024 00:57:58 +0500 Subject: [PATCH 7/7] Revert "test artifact upload from different nodes at the same time" This reverts commit 8a2be468fc2e22abd4db2a4180b770779118b6b1. --- spec/system/admin/order_spec.rb | 1 - spec/system/consumer/account_spec.rb | 1 - 2 files changed, 2 deletions(-) diff --git a/spec/system/admin/order_spec.rb b/spec/system/admin/order_spec.rb index 2525d76387..90c5028f39 100644 --- a/spec/system/admin/order_spec.rb +++ b/spec/system/admin/order_spec.rb @@ -100,7 +100,6 @@ RSpec.describe ' it 'shows error when order cycle is not selected' do select2_select distributor.name, from: 'order_distributor_id' click_button 'Next' - raise 'Testing artifact upload from different nodes at the same time' expect(page).to have_content "Order cycle can't be blank" end diff --git a/spec/system/consumer/account_spec.rb b/spec/system/consumer/account_spec.rb index 3d72fad016..ed984f3452 100644 --- a/spec/system/consumer/account_spec.rb +++ b/spec/system/consumer/account_spec.rb @@ -92,7 +92,6 @@ RSpec.describe ' it "shows such orders in a section labelled 'Open Orders'" do visit '/account' expect(page).to have_content 'Open Orders' - raise 'Testing artifact upload from different nodes at the same time' expect(page).to have_link 'Edit', href: order_path(d1o1) expect(page).to have_link 'Edit', href: order_path(d1o2)