From f07decf956c71b0f1a75455d6276fb7d29aac1bd Mon Sep 17 00:00:00 2001 From: jamelreid Date: Tue, 25 Jan 2022 16:48:28 -0500 Subject: [PATCH 01/19] Updated extraction path --- .github/workflows/smoke-test-daily.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/smoke-test-daily.yml b/.github/workflows/smoke-test-daily.yml index d642f012abe..37c8a702a10 100644 --- a/.github/workflows/smoke-test-daily.yml +++ b/.github/workflows/smoke-test-daily.yml @@ -132,7 +132,7 @@ jobs: working-directory: tmp run: | unzip woocommerce.zip -d woocommerce - mv woocommerce/woocommerce/* ../package/woocommerce/plugins/woocommerce/ + mv woocommerce/woocommerce/* ../package/woocommerce/plugins/woocommerce/tests/e2e/plugins/ - name: Install dependencies again working-directory: package/woocommerce From e2eea8140f6078eb76c2bf8920e90ab8d78433f3 Mon Sep 17 00:00:00 2001 From: jamelreid Date: Wed, 26 Jan 2022 09:49:41 -0500 Subject: [PATCH 02/19] Added a workflow to test daily smoke tests at will --- .github/workflows/smoke-test-daily-test.yml | 147 ++++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 .github/workflows/smoke-test-daily-test.yml diff --git a/.github/workflows/smoke-test-daily-test.yml b/.github/workflows/smoke-test-daily-test.yml new file mode 100644 index 00000000000..a50c6648f2d --- /dev/null +++ b/.github/workflows/smoke-test-daily-test.yml @@ -0,0 +1,147 @@ +name: Smoke test daily Test +on: + pull_request: + branches: + - trunk + types: + - labeled +jobs: + login-run: + name: Daily smoke test on trunk. + if: "${{ contains(github.event.label.name, 'run: daily tests') }}" + runs-on: ubuntu-18.04 + steps: + + - name: Create dirs. + run: | + mkdir -p code/woocommerce + mkdir -p package/woocommerce + mkdir -p tmp/woocommerce + mkdir -p node_modules + + - name: Checkout code. + uses: actions/checkout@v2 + with: + path: package/woocommerce + ref: trunk + + - name: Install prerequisites. + working-directory: package/woocommerce/plugins/woocommerce + run: | + npm install -g pnpm + pnpm install + pnpm nx composer-install-no-dev woocommerce + pnpm nx build-assets woocommerce + pnpm install jest + + - name: Run smoke test. + working-directory: package/woocommerce/plugins/woocommerce + env: + SMOKE_TEST_URL: ${{ secrets.SMOKE_TEST_URL }} + SMOKE_TEST_ADMIN_USER: ${{ secrets.SMOKE_TEST_ADMIN_USER }} + SMOKE_TEST_ADMIN_PASSWORD: ${{ secrets.SMOKE_TEST_ADMIN_PASSWORD }} + SMOKE_TEST_ADMIN_USER_EMAIL: ${{ secrets.SMOKE_TEST_ADMIN_USER_EMAIL }} + SMOKE_TEST_CUSTOMER_USER: ${{ secrets.SMOKE_TEST_CUSTOMER_USER }} + SMOKE_TEST_CUSTOMER_PASSWORD: ${{ secrets.SMOKE_TEST_CUSTOMER_PASSWORD }} + WC_E2E_SCREENSHOTS: 1 + E2E_RETEST: 1 + E2E_SLACK_TOKEN: ${{ secrets.SMOKE_TEST_SLACK_TOKEN }} + E2E_SLACK_CHANNEL: ${{ secrets.SMOKE_TEST_SLACK_CHANNEL }} + UPDATE_WC: 1 + DEFAULT_TIMEOUT_OVERRIDE: 120000 + BASE_URL: ${{ secrets.SMOKE_TEST_URL }} + USER_KEY: ${{ secrets.SMOKE_TEST_ADMIN_USER }} + USER_SECRET: ${{ secrets.SMOKE_TEST_ADMIN_PASSWORD }} + run: | + pnpx wc-e2e test:e2e tests/e2e/specs/smoke-tests/update-woocommerce.js + pnpx wc-e2e test:e2e + pnpx wc-api-tests test api + + build: + name: Build zip for PR + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Build + id: build + uses: woocommerce/action-build@trunk + env: + BUILD_ENV: e2e + + - name: Upload PR zip + uses: actions/upload-artifact@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + name: woocommerce + path: ${{ steps.build.outputs.zip_path }} + retention-days: 7 + + test-plugins: + name: Smoke tests with ${{ matrix.plugin }} plugin installed + runs-on: ubuntu-18.04 + needs: [build] + strategy: + fail-fast: false + matrix: + include: + - plugin: 'WooCommerce Payments' + repo: 'automattic/woocommerce-payments' + steps: + - name: Create dirs. + run: | + mkdir -p code/woocommerce + mkdir -p package/woocommerce + mkdir -p tmp/woocommerce + mkdir -p node_modules + + - name: Checkout code. + uses: actions/checkout@v2 + with: + path: package/woocommerce + + - name: Install PNPM and install dependencies + working-directory: package/woocommerce + run: | + npm install -g pnpm + pnpm install + + - name: Load docker images and start containers. + working-directory: package/woocommerce/plugins/woocommerce + run: pnpx wc-e2e docker:up + + - name: Move current directory to code. We will install zip file in this dir later. + run: mv ./package/woocommerce/plugins/woocommerce/* ./code/woocommerce + + - name: Download WooCommerce ZIP. + uses: actions/download-artifact@v2 + with: + name: woocommerce + path: tmp + + - name: Extract and replace WooCommerce zip. + working-directory: tmp + run: | + unzip woocommerce.zip -d woocommerce + mv woocommerce/woocommerce/* ../package/woocommerce/plugins/woocommerce/tests/e2e/plugins/ + + - name: Install dependencies again + working-directory: package/woocommerce + run: | + npm install -g pnpm + pnpm install + + - name: Run tests command. + working-directory: package/woocommerce/plugins/woocommerce + env: + WC_E2E_SCREENSHOTS: 1 + E2E_SLACK_TOKEN: ${{ secrets.SMOKE_TEST_SLACK_TOKEN }} + E2E_SLACK_CHANNEL: ${{ secrets.RELEASE_TEST_SLACK_CHANNEL }} + GITHUB_REPOSITORY: ${{ matrix.private && secrets[matrix.repo] || matrix.repo }} + PLUGIN_NAME: ${{ matrix.plugin }} + GITHUB_TOKEN: ${{ secrets.E2E_GH_TOKEN }} + run: | + pnpx wc-e2e test:e2e tests/e2e/specs/smoke-tests/upload-plugin.js + pnpm nx test-e2e woocommerce From 457f4b0160a4e446632d6ab69b9747428fd3a60a Mon Sep 17 00:00:00 2001 From: jamelreid Date: Wed, 26 Jan 2022 10:11:12 -0500 Subject: [PATCH 03/19] Ensure that the directory is created --- .github/workflows/smoke-test-daily-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/smoke-test-daily-test.yml b/.github/workflows/smoke-test-daily-test.yml index a50c6648f2d..2eac5d060cb 100644 --- a/.github/workflows/smoke-test-daily-test.yml +++ b/.github/workflows/smoke-test-daily-test.yml @@ -124,6 +124,7 @@ jobs: - name: Extract and replace WooCommerce zip. working-directory: tmp run: | + mkdir -p ../package/woocommerce/plugins/woocommerce/tests/e2e/plugins unzip woocommerce.zip -d woocommerce mv woocommerce/woocommerce/* ../package/woocommerce/plugins/woocommerce/tests/e2e/plugins/ From 28e87eeb3d38b9cb81fe282a3b7011a4b9977c60 Mon Sep 17 00:00:00 2001 From: jamelreid Date: Wed, 26 Jan 2022 10:23:57 -0500 Subject: [PATCH 04/19] Removed step reduce execution time --- .github/workflows/smoke-test-daily-test.yml | 51 --------------------- 1 file changed, 51 deletions(-) diff --git a/.github/workflows/smoke-test-daily-test.yml b/.github/workflows/smoke-test-daily-test.yml index 2eac5d060cb..a005bb96843 100644 --- a/.github/workflows/smoke-test-daily-test.yml +++ b/.github/workflows/smoke-test-daily-test.yml @@ -6,57 +6,6 @@ on: types: - labeled jobs: - login-run: - name: Daily smoke test on trunk. - if: "${{ contains(github.event.label.name, 'run: daily tests') }}" - runs-on: ubuntu-18.04 - steps: - - - name: Create dirs. - run: | - mkdir -p code/woocommerce - mkdir -p package/woocommerce - mkdir -p tmp/woocommerce - mkdir -p node_modules - - - name: Checkout code. - uses: actions/checkout@v2 - with: - path: package/woocommerce - ref: trunk - - - name: Install prerequisites. - working-directory: package/woocommerce/plugins/woocommerce - run: | - npm install -g pnpm - pnpm install - pnpm nx composer-install-no-dev woocommerce - pnpm nx build-assets woocommerce - pnpm install jest - - - name: Run smoke test. - working-directory: package/woocommerce/plugins/woocommerce - env: - SMOKE_TEST_URL: ${{ secrets.SMOKE_TEST_URL }} - SMOKE_TEST_ADMIN_USER: ${{ secrets.SMOKE_TEST_ADMIN_USER }} - SMOKE_TEST_ADMIN_PASSWORD: ${{ secrets.SMOKE_TEST_ADMIN_PASSWORD }} - SMOKE_TEST_ADMIN_USER_EMAIL: ${{ secrets.SMOKE_TEST_ADMIN_USER_EMAIL }} - SMOKE_TEST_CUSTOMER_USER: ${{ secrets.SMOKE_TEST_CUSTOMER_USER }} - SMOKE_TEST_CUSTOMER_PASSWORD: ${{ secrets.SMOKE_TEST_CUSTOMER_PASSWORD }} - WC_E2E_SCREENSHOTS: 1 - E2E_RETEST: 1 - E2E_SLACK_TOKEN: ${{ secrets.SMOKE_TEST_SLACK_TOKEN }} - E2E_SLACK_CHANNEL: ${{ secrets.SMOKE_TEST_SLACK_CHANNEL }} - UPDATE_WC: 1 - DEFAULT_TIMEOUT_OVERRIDE: 120000 - BASE_URL: ${{ secrets.SMOKE_TEST_URL }} - USER_KEY: ${{ secrets.SMOKE_TEST_ADMIN_USER }} - USER_SECRET: ${{ secrets.SMOKE_TEST_ADMIN_PASSWORD }} - run: | - pnpx wc-e2e test:e2e tests/e2e/specs/smoke-tests/update-woocommerce.js - pnpx wc-e2e test:e2e - pnpx wc-api-tests test api - build: name: Build zip for PR runs-on: ubuntu-latest From cd8af3e2c412d33d6767bc395ee80605aee36c21 Mon Sep 17 00:00:00 2001 From: jamelreid Date: Wed, 26 Jan 2022 11:32:15 -0500 Subject: [PATCH 05/19] Updated GITHUB_REPOSITORY in test workflow --- .github/workflows/smoke-test-daily-test.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/smoke-test-daily-test.yml b/.github/workflows/smoke-test-daily-test.yml index a005bb96843..13aec34ea67 100644 --- a/.github/workflows/smoke-test-daily-test.yml +++ b/.github/workflows/smoke-test-daily-test.yml @@ -73,9 +73,8 @@ jobs: - name: Extract and replace WooCommerce zip. working-directory: tmp run: | - mkdir -p ../package/woocommerce/plugins/woocommerce/tests/e2e/plugins unzip woocommerce.zip -d woocommerce - mv woocommerce/woocommerce/* ../package/woocommerce/plugins/woocommerce/tests/e2e/plugins/ + mv woocommerce/woocommerce/* ../package/woocommerce/plugins/woocommerce/ - name: Install dependencies again working-directory: package/woocommerce @@ -89,7 +88,7 @@ jobs: WC_E2E_SCREENSHOTS: 1 E2E_SLACK_TOKEN: ${{ secrets.SMOKE_TEST_SLACK_TOKEN }} E2E_SLACK_CHANNEL: ${{ secrets.RELEASE_TEST_SLACK_CHANNEL }} - GITHUB_REPOSITORY: ${{ matrix.private && secrets[matrix.repo] || matrix.repo }} + GITHUB_REPOSITORY: ${{ matrix.repo }} PLUGIN_NAME: ${{ matrix.plugin }} GITHUB_TOKEN: ${{ secrets.E2E_GH_TOKEN }} run: | From a631454b91606eff34ab80fd762e13993bec3ae8 Mon Sep 17 00:00:00 2001 From: jamelreid Date: Wed, 26 Jan 2022 11:53:43 -0500 Subject: [PATCH 06/19] Updated describe block for better logging --- .../e2e/specs/smoke-tests/upload-plugin.js | 39 +++++++++++-------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/plugins/woocommerce/tests/e2e/specs/smoke-tests/upload-plugin.js b/plugins/woocommerce/tests/e2e/specs/smoke-tests/upload-plugin.js index 1bdb3a950a4..7dfe7304b2d 100644 --- a/plugins/woocommerce/tests/e2e/specs/smoke-tests/upload-plugin.js +++ b/plugins/woocommerce/tests/e2e/specs/smoke-tests/upload-plugin.js @@ -18,25 +18,30 @@ const { GITHUB_REPOSITORY, PLUGIN_NAME, GITHUB_TOKEN } = process.env; let zipUrl; let pluginPath; -utils.describeIf( GITHUB_REPOSITORY )( 'Upload and activate plugin', () => { - beforeAll( async () => { - zipUrl = await getLatestReleaseZipUrl( GITHUB_REPOSITORY, GITHUB_TOKEN ); +utils.describeIf( GITHUB_REPOSITORY )( + `Upload and activate ${ PLUGIN_NAME } from ${ GITHUB_REPOSITORY }`, + () => { + beforeAll( async () => { + zipUrl = await getLatestReleaseZipUrl( + GITHUB_REPOSITORY, + GITHUB_TOKEN + ); - pluginPath = await getRemotePluginZip( zipUrl, GITHUB_TOKEN ); + pluginPath = await getRemotePluginZip( zipUrl, GITHUB_TOKEN ); - await merchant.login(); - }); + await merchant.login(); + } ); - afterAll( async () => { - await merchant.logout(); - }); + afterAll( async () => { + await merchant.logout(); + } ); - it( 'can upload and activate the provided plugin', async () => { - await merchant.uploadAndActivatePlugin( pluginPath, PLUGIN_NAME ); - }); + it( 'can upload and activate the provided plugin', async () => { + await merchant.uploadAndActivatePlugin( pluginPath, PLUGIN_NAME ); + } ); - it( 'can remove downloaded plugin zip', async () => { - await deleteDownloadedPluginFiles(); - } ); - -}); + it( 'can remove downloaded plugin zip', async () => { + await deleteDownloadedPluginFiles(); + } ); + } +); From fcf3d0fb5d757ba12d19f4ab71c712fb43a7f803 Mon Sep 17 00:00:00 2001 From: jamelreid Date: Wed, 26 Jan 2022 12:24:43 -0500 Subject: [PATCH 07/19] Set GITHUB_REPOSITORY test --- .github/workflows/smoke-test-daily-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/smoke-test-daily-test.yml b/.github/workflows/smoke-test-daily-test.yml index 13aec34ea67..225ce94b708 100644 --- a/.github/workflows/smoke-test-daily-test.yml +++ b/.github/workflows/smoke-test-daily-test.yml @@ -92,5 +92,7 @@ jobs: PLUGIN_NAME: ${{ matrix.plugin }} GITHUB_TOKEN: ${{ secrets.E2E_GH_TOKEN }} run: | + echo "GITHUB_REPOSITORY=${{ matrix.repo }}}" + echo $GITHUB_REPOSITORY pnpx wc-e2e test:e2e tests/e2e/specs/smoke-tests/upload-plugin.js pnpm nx test-e2e woocommerce From e771145aa0b53e1a60095abf3909d084a28d8dbd Mon Sep 17 00:00:00 2001 From: jamelreid Date: Wed, 26 Jan 2022 12:49:05 -0500 Subject: [PATCH 08/19] Added a PLUGIN_REPOSITORY variable --- .github/workflows/smoke-test-daily-test.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/smoke-test-daily-test.yml b/.github/workflows/smoke-test-daily-test.yml index 225ce94b708..d78e908b054 100644 --- a/.github/workflows/smoke-test-daily-test.yml +++ b/.github/workflows/smoke-test-daily-test.yml @@ -88,11 +88,9 @@ jobs: WC_E2E_SCREENSHOTS: 1 E2E_SLACK_TOKEN: ${{ secrets.SMOKE_TEST_SLACK_TOKEN }} E2E_SLACK_CHANNEL: ${{ secrets.RELEASE_TEST_SLACK_CHANNEL }} - GITHUB_REPOSITORY: ${{ matrix.repo }} + PLUGIN_REPOSITORY: ${{ matrix.private && secrets[matrix.repo] || matrix.repo }} PLUGIN_NAME: ${{ matrix.plugin }} GITHUB_TOKEN: ${{ secrets.E2E_GH_TOKEN }} run: | - echo "GITHUB_REPOSITORY=${{ matrix.repo }}}" - echo $GITHUB_REPOSITORY pnpx wc-e2e test:e2e tests/e2e/specs/smoke-tests/upload-plugin.js pnpm nx test-e2e woocommerce From 8158343c741de223472228fb3a0fe4399a9e3be6 Mon Sep 17 00:00:00 2001 From: jamelreid Date: Wed, 26 Jan 2022 12:49:32 -0500 Subject: [PATCH 09/19] Added support for PLUGIN_REPOSITORY & PLUGIN_NAME --- .../tests/e2e/specs/smoke-tests/upload-plugin.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/plugins/woocommerce/tests/e2e/specs/smoke-tests/upload-plugin.js b/plugins/woocommerce/tests/e2e/specs/smoke-tests/upload-plugin.js index 7dfe7304b2d..cbfa48d1186 100644 --- a/plugins/woocommerce/tests/e2e/specs/smoke-tests/upload-plugin.js +++ b/plugins/woocommerce/tests/e2e/specs/smoke-tests/upload-plugin.js @@ -13,19 +13,20 @@ const { beforeAll, } = require( '@jest/globals' ); -const { GITHUB_REPOSITORY, PLUGIN_NAME, GITHUB_TOKEN } = process.env; +const { GITHUB_REPOSITORY, PLUGIN_NAME, GITHUB_TOKEN, PLUGIN_REPOSITORY } = process.env; + +// allows us to upload plugins from different repositories. +const pluginName = PLUGIN_NAME ? PLUGIN_NAME : 'WooCommerce'; +const repository = PLUGIN_REPOSITORY ? PLUGIN_REPOSITORY : GITHUB_REPOSITORY; let zipUrl; let pluginPath; -utils.describeIf( GITHUB_REPOSITORY )( - `Upload and activate ${ PLUGIN_NAME } from ${ GITHUB_REPOSITORY }`, +utils.describeIf( GITHUB_REPOSITORY || PLUGIN_REPOSITORY )( + `Upload and activate ${ pluginName } from ${ repository }`, () => { beforeAll( async () => { - zipUrl = await getLatestReleaseZipUrl( - GITHUB_REPOSITORY, - GITHUB_TOKEN - ); + zipUrl = await getLatestReleaseZipUrl( repository, GITHUB_TOKEN ); pluginPath = await getRemotePluginZip( zipUrl, GITHUB_TOKEN ); From f5bbebb95bf74442daa7a568808ec31b9bd4a638 Mon Sep 17 00:00:00 2001 From: jamelreid Date: Wed, 26 Jan 2022 13:08:46 -0500 Subject: [PATCH 10/19] Updated test command --- .github/workflows/smoke-test-daily-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/smoke-test-daily-test.yml b/.github/workflows/smoke-test-daily-test.yml index d78e908b054..992e0a784f5 100644 --- a/.github/workflows/smoke-test-daily-test.yml +++ b/.github/workflows/smoke-test-daily-test.yml @@ -93,4 +93,4 @@ jobs: GITHUB_TOKEN: ${{ secrets.E2E_GH_TOKEN }} run: | pnpx wc-e2e test:e2e tests/e2e/specs/smoke-tests/upload-plugin.js - pnpm nx test-e2e woocommerce + pnpm wc-e2e test-e2e From c0b3712398d998b3f02d6bfddc80fb932c51187d Mon Sep 17 00:00:00 2001 From: jamelreid Date: Wed, 26 Jan 2022 13:20:34 -0500 Subject: [PATCH 11/19] Updated test command --- .github/workflows/smoke-test-daily-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/smoke-test-daily-test.yml b/.github/workflows/smoke-test-daily-test.yml index 992e0a784f5..a6bad09e22a 100644 --- a/.github/workflows/smoke-test-daily-test.yml +++ b/.github/workflows/smoke-test-daily-test.yml @@ -93,4 +93,4 @@ jobs: GITHUB_TOKEN: ${{ secrets.E2E_GH_TOKEN }} run: | pnpx wc-e2e test:e2e tests/e2e/specs/smoke-tests/upload-plugin.js - pnpm wc-e2e test-e2e + pnpx wc-e2e test-e2e From df7e0c72ff81465d4a325e3793eacd8282b4c1c0 Mon Sep 17 00:00:00 2001 From: jamelreid Date: Wed, 26 Jan 2022 13:32:58 -0500 Subject: [PATCH 12/19] Fixed test command --- .github/workflows/smoke-test-daily-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/smoke-test-daily-test.yml b/.github/workflows/smoke-test-daily-test.yml index a6bad09e22a..9853d03cac0 100644 --- a/.github/workflows/smoke-test-daily-test.yml +++ b/.github/workflows/smoke-test-daily-test.yml @@ -93,4 +93,4 @@ jobs: GITHUB_TOKEN: ${{ secrets.E2E_GH_TOKEN }} run: | pnpx wc-e2e test:e2e tests/e2e/specs/smoke-tests/upload-plugin.js - pnpx wc-e2e test-e2e + pnpx wc-e2e test:e2e From 464839bfe240cb0194e33d05e37e1f865fdc1541 Mon Sep 17 00:00:00 2001 From: jamelreid Date: Wed, 26 Jan 2022 13:56:43 -0500 Subject: [PATCH 13/19] Changed GITHUB_REPOSITORY to PLUGIN_REPOSITORY Also updated the test command and reverted previous changes done in this PR. --- .github/workflows/smoke-test-daily.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/smoke-test-daily.yml b/.github/workflows/smoke-test-daily.yml index 37c8a702a10..c130a9b1738 100644 --- a/.github/workflows/smoke-test-daily.yml +++ b/.github/workflows/smoke-test-daily.yml @@ -132,7 +132,7 @@ jobs: working-directory: tmp run: | unzip woocommerce.zip -d woocommerce - mv woocommerce/woocommerce/* ../package/woocommerce/plugins/woocommerce/tests/e2e/plugins/ + mv woocommerce/woocommerce/* ../package/woocommerce/plugins/woocommerce/ - name: Install dependencies again working-directory: package/woocommerce @@ -146,9 +146,9 @@ jobs: WC_E2E_SCREENSHOTS: 1 E2E_SLACK_TOKEN: ${{ secrets.SMOKE_TEST_SLACK_TOKEN }} E2E_SLACK_CHANNEL: ${{ secrets.RELEASE_TEST_SLACK_CHANNEL }} - GITHUB_REPOSITORY: ${{ matrix.private && secrets[matrix.repo] || matrix.repo }} + PLUGIN_REPOSITORY: ${{ matrix.private && secrets[matrix.repo] || matrix.repo }} PLUGIN_NAME: ${{ matrix.plugin }} GITHUB_TOKEN: ${{ secrets.E2E_GH_TOKEN }} run: | pnpx wc-e2e test:e2e tests/e2e/specs/smoke-tests/upload-plugin.js - pnpm nx test-e2e woocommerce + pnpx wc-e2e test-e2e From b690b16247d164c312c4d63809802cd9e029e452 Mon Sep 17 00:00:00 2001 From: jamelreid Date: Wed, 26 Jan 2022 14:03:36 -0500 Subject: [PATCH 14/19] Removed test workflow file --- .github/workflows/smoke-test-daily-test.yml | 96 --------------------- 1 file changed, 96 deletions(-) delete mode 100644 .github/workflows/smoke-test-daily-test.yml diff --git a/.github/workflows/smoke-test-daily-test.yml b/.github/workflows/smoke-test-daily-test.yml deleted file mode 100644 index 9853d03cac0..00000000000 --- a/.github/workflows/smoke-test-daily-test.yml +++ /dev/null @@ -1,96 +0,0 @@ -name: Smoke test daily Test -on: - pull_request: - branches: - - trunk - types: - - labeled -jobs: - build: - name: Build zip for PR - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Build - id: build - uses: woocommerce/action-build@trunk - env: - BUILD_ENV: e2e - - - name: Upload PR zip - uses: actions/upload-artifact@v2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - name: woocommerce - path: ${{ steps.build.outputs.zip_path }} - retention-days: 7 - - test-plugins: - name: Smoke tests with ${{ matrix.plugin }} plugin installed - runs-on: ubuntu-18.04 - needs: [build] - strategy: - fail-fast: false - matrix: - include: - - plugin: 'WooCommerce Payments' - repo: 'automattic/woocommerce-payments' - steps: - - name: Create dirs. - run: | - mkdir -p code/woocommerce - mkdir -p package/woocommerce - mkdir -p tmp/woocommerce - mkdir -p node_modules - - - name: Checkout code. - uses: actions/checkout@v2 - with: - path: package/woocommerce - - - name: Install PNPM and install dependencies - working-directory: package/woocommerce - run: | - npm install -g pnpm - pnpm install - - - name: Load docker images and start containers. - working-directory: package/woocommerce/plugins/woocommerce - run: pnpx wc-e2e docker:up - - - name: Move current directory to code. We will install zip file in this dir later. - run: mv ./package/woocommerce/plugins/woocommerce/* ./code/woocommerce - - - name: Download WooCommerce ZIP. - uses: actions/download-artifact@v2 - with: - name: woocommerce - path: tmp - - - name: Extract and replace WooCommerce zip. - working-directory: tmp - run: | - unzip woocommerce.zip -d woocommerce - mv woocommerce/woocommerce/* ../package/woocommerce/plugins/woocommerce/ - - - name: Install dependencies again - working-directory: package/woocommerce - run: | - npm install -g pnpm - pnpm install - - - name: Run tests command. - working-directory: package/woocommerce/plugins/woocommerce - env: - WC_E2E_SCREENSHOTS: 1 - E2E_SLACK_TOKEN: ${{ secrets.SMOKE_TEST_SLACK_TOKEN }} - E2E_SLACK_CHANNEL: ${{ secrets.RELEASE_TEST_SLACK_CHANNEL }} - PLUGIN_REPOSITORY: ${{ matrix.private && secrets[matrix.repo] || matrix.repo }} - PLUGIN_NAME: ${{ matrix.plugin }} - GITHUB_TOKEN: ${{ secrets.E2E_GH_TOKEN }} - run: | - pnpx wc-e2e test:e2e tests/e2e/specs/smoke-tests/upload-plugin.js - pnpx wc-e2e test:e2e From b66b7542440894ef9836b2c3b896261c8b8d4676 Mon Sep 17 00:00:00 2001 From: jamelreid Date: Wed, 26 Jan 2022 14:21:51 -0500 Subject: [PATCH 15/19] Fixed test command --- .github/workflows/smoke-test-daily.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/smoke-test-daily.yml b/.github/workflows/smoke-test-daily.yml index c130a9b1738..2bb316e7363 100644 --- a/.github/workflows/smoke-test-daily.yml +++ b/.github/workflows/smoke-test-daily.yml @@ -151,4 +151,4 @@ jobs: GITHUB_TOKEN: ${{ secrets.E2E_GH_TOKEN }} run: | pnpx wc-e2e test:e2e tests/e2e/specs/smoke-tests/upload-plugin.js - pnpx wc-e2e test-e2e + pnpx wc-e2e test:e2e From 122ea458aecb14214d20fb9826c638ceb1d8ddc2 Mon Sep 17 00:00:00 2001 From: jamelreid Date: Wed, 26 Jan 2022 14:22:25 -0500 Subject: [PATCH 16/19] Updated to match changes in smoke-test-daily.yml --- .github/workflows/smoke-test-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/smoke-test-release.yml b/.github/workflows/smoke-test-release.yml index f6a6acee5a3..fda4e18c327 100644 --- a/.github/workflows/smoke-test-release.yml +++ b/.github/workflows/smoke-test-release.yml @@ -170,9 +170,9 @@ jobs: WC_E2E_SCREENSHOTS: 1 E2E_SLACK_TOKEN: ${{ secrets.SMOKE_TEST_SLACK_TOKEN }} E2E_SLACK_CHANNEL: ${{ secrets.RELEASE_TEST_SLACK_CHANNEL }} - GITHUB_REPOSITORY: ${{ matrix.private && secrets[matrix.repo] || matrix.repo }} + PLUGIN_REPOSITORY: ${{ matrix.private && secrets[matrix.repo] || matrix.repo }} PLUGIN_NAME: ${{ matrix.plugin }} GITHUB_TOKEN: ${{ secrets.E2E_GH_TOKEN }} run: | pnpx wc-e2e test:e2e tests/e2e/specs/smoke-tests/upload-plugin.js - pnpm nx test-e2e woocommerce + pnpx wc-e2e test:e2e From 70091b2a35059ffc533564d6206fd4a76a40294f Mon Sep 17 00:00:00 2001 From: jamelreid Date: Wed, 26 Jan 2022 17:07:10 -0500 Subject: [PATCH 17/19] Updated describeIf to use repository variable --- .../woocommerce/tests/e2e/specs/smoke-tests/upload-plugin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/woocommerce/tests/e2e/specs/smoke-tests/upload-plugin.js b/plugins/woocommerce/tests/e2e/specs/smoke-tests/upload-plugin.js index cbfa48d1186..7526b336f00 100644 --- a/plugins/woocommerce/tests/e2e/specs/smoke-tests/upload-plugin.js +++ b/plugins/woocommerce/tests/e2e/specs/smoke-tests/upload-plugin.js @@ -22,7 +22,7 @@ const repository = PLUGIN_REPOSITORY ? PLUGIN_REPOSITORY : GITHUB_REPOSITORY; let zipUrl; let pluginPath; -utils.describeIf( GITHUB_REPOSITORY || PLUGIN_REPOSITORY )( +utils.describeIf( repository )( `Upload and activate ${ pluginName } from ${ repository }`, () => { beforeAll( async () => { From 3ff19df36fbc876875790b25ad12416e8c72c449 Mon Sep 17 00:00:00 2001 From: jamelreid Date: Wed, 26 Jan 2022 17:07:25 -0500 Subject: [PATCH 18/19] Added .yml file to test workflow --- .github/workflows/smoke-test-daily-test.yml | 96 +++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 .github/workflows/smoke-test-daily-test.yml diff --git a/.github/workflows/smoke-test-daily-test.yml b/.github/workflows/smoke-test-daily-test.yml new file mode 100644 index 00000000000..9853d03cac0 --- /dev/null +++ b/.github/workflows/smoke-test-daily-test.yml @@ -0,0 +1,96 @@ +name: Smoke test daily Test +on: + pull_request: + branches: + - trunk + types: + - labeled +jobs: + build: + name: Build zip for PR + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Build + id: build + uses: woocommerce/action-build@trunk + env: + BUILD_ENV: e2e + + - name: Upload PR zip + uses: actions/upload-artifact@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + name: woocommerce + path: ${{ steps.build.outputs.zip_path }} + retention-days: 7 + + test-plugins: + name: Smoke tests with ${{ matrix.plugin }} plugin installed + runs-on: ubuntu-18.04 + needs: [build] + strategy: + fail-fast: false + matrix: + include: + - plugin: 'WooCommerce Payments' + repo: 'automattic/woocommerce-payments' + steps: + - name: Create dirs. + run: | + mkdir -p code/woocommerce + mkdir -p package/woocommerce + mkdir -p tmp/woocommerce + mkdir -p node_modules + + - name: Checkout code. + uses: actions/checkout@v2 + with: + path: package/woocommerce + + - name: Install PNPM and install dependencies + working-directory: package/woocommerce + run: | + npm install -g pnpm + pnpm install + + - name: Load docker images and start containers. + working-directory: package/woocommerce/plugins/woocommerce + run: pnpx wc-e2e docker:up + + - name: Move current directory to code. We will install zip file in this dir later. + run: mv ./package/woocommerce/plugins/woocommerce/* ./code/woocommerce + + - name: Download WooCommerce ZIP. + uses: actions/download-artifact@v2 + with: + name: woocommerce + path: tmp + + - name: Extract and replace WooCommerce zip. + working-directory: tmp + run: | + unzip woocommerce.zip -d woocommerce + mv woocommerce/woocommerce/* ../package/woocommerce/plugins/woocommerce/ + + - name: Install dependencies again + working-directory: package/woocommerce + run: | + npm install -g pnpm + pnpm install + + - name: Run tests command. + working-directory: package/woocommerce/plugins/woocommerce + env: + WC_E2E_SCREENSHOTS: 1 + E2E_SLACK_TOKEN: ${{ secrets.SMOKE_TEST_SLACK_TOKEN }} + E2E_SLACK_CHANNEL: ${{ secrets.RELEASE_TEST_SLACK_CHANNEL }} + PLUGIN_REPOSITORY: ${{ matrix.private && secrets[matrix.repo] || matrix.repo }} + PLUGIN_NAME: ${{ matrix.plugin }} + GITHUB_TOKEN: ${{ secrets.E2E_GH_TOKEN }} + run: | + pnpx wc-e2e test:e2e tests/e2e/specs/smoke-tests/upload-plugin.js + pnpx wc-e2e test:e2e From 7da9e3c32e17d6115dd41c0904ce58118b311f7c Mon Sep 17 00:00:00 2001 From: jamelreid Date: Wed, 26 Jan 2022 17:29:29 -0500 Subject: [PATCH 19/19] Removed test .yml file --- .github/workflows/smoke-test-daily-test.yml | 96 --------------------- 1 file changed, 96 deletions(-) delete mode 100644 .github/workflows/smoke-test-daily-test.yml diff --git a/.github/workflows/smoke-test-daily-test.yml b/.github/workflows/smoke-test-daily-test.yml deleted file mode 100644 index 9853d03cac0..00000000000 --- a/.github/workflows/smoke-test-daily-test.yml +++ /dev/null @@ -1,96 +0,0 @@ -name: Smoke test daily Test -on: - pull_request: - branches: - - trunk - types: - - labeled -jobs: - build: - name: Build zip for PR - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Build - id: build - uses: woocommerce/action-build@trunk - env: - BUILD_ENV: e2e - - - name: Upload PR zip - uses: actions/upload-artifact@v2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - name: woocommerce - path: ${{ steps.build.outputs.zip_path }} - retention-days: 7 - - test-plugins: - name: Smoke tests with ${{ matrix.plugin }} plugin installed - runs-on: ubuntu-18.04 - needs: [build] - strategy: - fail-fast: false - matrix: - include: - - plugin: 'WooCommerce Payments' - repo: 'automattic/woocommerce-payments' - steps: - - name: Create dirs. - run: | - mkdir -p code/woocommerce - mkdir -p package/woocommerce - mkdir -p tmp/woocommerce - mkdir -p node_modules - - - name: Checkout code. - uses: actions/checkout@v2 - with: - path: package/woocommerce - - - name: Install PNPM and install dependencies - working-directory: package/woocommerce - run: | - npm install -g pnpm - pnpm install - - - name: Load docker images and start containers. - working-directory: package/woocommerce/plugins/woocommerce - run: pnpx wc-e2e docker:up - - - name: Move current directory to code. We will install zip file in this dir later. - run: mv ./package/woocommerce/plugins/woocommerce/* ./code/woocommerce - - - name: Download WooCommerce ZIP. - uses: actions/download-artifact@v2 - with: - name: woocommerce - path: tmp - - - name: Extract and replace WooCommerce zip. - working-directory: tmp - run: | - unzip woocommerce.zip -d woocommerce - mv woocommerce/woocommerce/* ../package/woocommerce/plugins/woocommerce/ - - - name: Install dependencies again - working-directory: package/woocommerce - run: | - npm install -g pnpm - pnpm install - - - name: Run tests command. - working-directory: package/woocommerce/plugins/woocommerce - env: - WC_E2E_SCREENSHOTS: 1 - E2E_SLACK_TOKEN: ${{ secrets.SMOKE_TEST_SLACK_TOKEN }} - E2E_SLACK_CHANNEL: ${{ secrets.RELEASE_TEST_SLACK_CHANNEL }} - PLUGIN_REPOSITORY: ${{ matrix.private && secrets[matrix.repo] || matrix.repo }} - PLUGIN_NAME: ${{ matrix.plugin }} - GITHUB_TOKEN: ${{ secrets.E2E_GH_TOKEN }} - run: | - pnpx wc-e2e test:e2e tests/e2e/specs/smoke-tests/upload-plugin.js - pnpx wc-e2e test:e2e