From b57651346c5685d7db9e594a0b1c882385dac8fd Mon Sep 17 00:00:00 2001 From: Oliver Gupte Date: Thu, 5 Nov 2020 17:08:38 -0800 Subject: [PATCH 1/4] Fixes apm e2e runner script by updating the yarn commands to match the script names defined in the package.json --- x-pack/plugins/apm/e2e/cypress/integration/snapshots.js | 4 ++-- x-pack/plugins/apm/e2e/run-e2e.sh | 4 ++-- x-pack/plugins/apm/e2e/yarn.lock | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 x-pack/plugins/apm/e2e/yarn.lock diff --git a/x-pack/plugins/apm/e2e/cypress/integration/snapshots.js b/x-pack/plugins/apm/e2e/cypress/integration/snapshots.js index 72b49bb85b7a5..0ecda7a113de7 100644 --- a/x-pack/plugins/apm/e2e/cypress/integration/snapshots.js +++ b/x-pack/plugins/apm/e2e/cypress/integration/snapshots.js @@ -1,3 +1,3 @@ module.exports = { - __version: '5.5.0', -}; + "__version": "5.4.0" +} diff --git a/x-pack/plugins/apm/e2e/run-e2e.sh b/x-pack/plugins/apm/e2e/run-e2e.sh index 6cdae93aec63b..0f7e6de7443da 100755 --- a/x-pack/plugins/apm/e2e/run-e2e.sh +++ b/x-pack/plugins/apm/e2e/run-e2e.sh @@ -165,7 +165,7 @@ echo "✅ Setup completed successfully. Running tests..." # # run cypress tests ################################################## -yarn cypress run --config pageLoadTimeout=100000,watchForFileChanges=true +yarn cypress:run --config pageLoadTimeout=100000,watchForFileChanges=true e2e_status=$? # @@ -173,7 +173,7 @@ e2e_status=$? ################################################## echo "${bold}If you want to run the test interactively, run:${normal}" echo "" # newline -echo "cd ${E2E_DIR} && yarn cypress open --config pageLoadTimeout=100000,watchForFileChanges=true" +echo "cd ${E2E_DIR} && yarn cypress:open --config pageLoadTimeout=100000,watchForFileChanges=true" # Report the e2e status at the very end if [ $e2e_status -ne 0 ]; then diff --git a/x-pack/plugins/apm/e2e/yarn.lock b/x-pack/plugins/apm/e2e/yarn.lock new file mode 100644 index 0000000000000..fb57ccd13afbd --- /dev/null +++ b/x-pack/plugins/apm/e2e/yarn.lock @@ -0,0 +1,4 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + From 6a1017e1449aca7d97255612b6f7be5b32b9c4ee Mon Sep 17 00:00:00 2001 From: Oliver Gupte Date: Thu, 5 Nov 2020 18:53:42 -0800 Subject: [PATCH 2/4] removes the yarn install step for cypress dependencies, since it's no longer necessary. --- x-pack/plugins/apm/e2e/run-e2e.sh | 8 -------- x-pack/plugins/apm/e2e/yarn.lock | 4 ---- 2 files changed, 12 deletions(-) delete mode 100644 x-pack/plugins/apm/e2e/yarn.lock diff --git a/x-pack/plugins/apm/e2e/run-e2e.sh b/x-pack/plugins/apm/e2e/run-e2e.sh index 0f7e6de7443da..ee030715da986 100755 --- a/x-pack/plugins/apm/e2e/run-e2e.sh +++ b/x-pack/plugins/apm/e2e/run-e2e.sh @@ -92,14 +92,6 @@ if [ $? -ne 0 ]; then exit 1 fi -# -# Cypress -################################################## -echo "" # newline -echo "${bold}Cypress (logs: ${E2E_DIR}${TMP_DIR}/e2e-yarn.log)${normal}" -echo "Installing cypress dependencies " -yarn &> ${TMP_DIR}/e2e-yarn.log - # # Static mock data ################################################## diff --git a/x-pack/plugins/apm/e2e/yarn.lock b/x-pack/plugins/apm/e2e/yarn.lock deleted file mode 100644 index fb57ccd13afbd..0000000000000 --- a/x-pack/plugins/apm/e2e/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - From 1516e3866f8cb119f90e05022c0465761c5c7ded Mon Sep 17 00:00:00 2001 From: Oliver Gupte Date: Thu, 5 Nov 2020 23:51:44 -0800 Subject: [PATCH 3/4] Removed apm/e2e/package.json --- x-pack/plugins/apm/e2e/package.json | 10 ---------- x-pack/plugins/apm/e2e/run-e2e.sh | 9 ++++++--- 2 files changed, 6 insertions(+), 13 deletions(-) delete mode 100644 x-pack/plugins/apm/e2e/package.json diff --git a/x-pack/plugins/apm/e2e/package.json b/x-pack/plugins/apm/e2e/package.json deleted file mode 100644 index 5839f4d58537c..0000000000000 --- a/x-pack/plugins/apm/e2e/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "apm-cypress", - "version": "1.0.0", - "main": "index.js", - "license": "MIT", - "scripts": { - "cypress:open": "../../../../node_modules/.bin/cypress open", - "cypress:run": "../../../../node_modules/.bin/cypress run --spec **/*.feature" - } -} \ No newline at end of file diff --git a/x-pack/plugins/apm/e2e/run-e2e.sh b/x-pack/plugins/apm/e2e/run-e2e.sh index ee030715da986..28acd0e63a34a 100755 --- a/x-pack/plugins/apm/e2e/run-e2e.sh +++ b/x-pack/plugins/apm/e2e/run-e2e.sh @@ -20,6 +20,9 @@ normal=$(tput sgr0) E2E_DIR="${0%/*}" TMP_DIR="tmp" APM_IT_DIR="tmp/apm-integration-testing" +KIBANA_DIR="${E2E_DIR}/../../../.." +WAIT_ON_BIN=$(yarn --cwd ${KIBANA_DIR} bin wait-on) +CYPRESS_BIN=$(yarn --cwd ${KIBANA_DIR} bin cypress) cd ${E2E_DIR} @@ -140,7 +143,7 @@ fi echo "" # newline echo "${bold}Waiting for Kibana to start...${normal}" echo "Note: you need to start Kibana manually. Find the instructions at the top." -yarn wait-on -i 500 -w 500 http-get://admin:changeme@localhost:$KIBANA_PORT/api/status > /dev/null +$WAIT_ON_BIN -i 500 -w 500 http-get://admin:changeme@localhost:$KIBANA_PORT/api/status > /dev/null ## Workaround to wait for the http server running ## See: https://github.com/elastic/kibana/issues/66326 @@ -157,7 +160,7 @@ echo "✅ Setup completed successfully. Running tests..." # # run cypress tests ################################################## -yarn cypress:run --config pageLoadTimeout=100000,watchForFileChanges=true +$CYPRESS_BIN run --config pageLoadTimeout=100000,watchForFileChanges=true e2e_status=$? # @@ -165,7 +168,7 @@ e2e_status=$? ################################################## echo "${bold}If you want to run the test interactively, run:${normal}" echo "" # newline -echo "cd ${E2E_DIR} && yarn cypress:open --config pageLoadTimeout=100000,watchForFileChanges=true" +echo "cd ${E2E_DIR} && ${CYPRESS_BIN} open --config pageLoadTimeout=100000,watchForFileChanges=true" # Report the e2e status at the very end if [ $e2e_status -ne 0 ]; then From 9fe967ef00b70a089911d175e357578f61a45521 Mon Sep 17 00:00:00 2001 From: Oliver Gupte Date: Fri, 6 Nov 2020 10:15:48 -0800 Subject: [PATCH 4/4] simplified paths for binary dependencies --- x-pack/plugins/apm/e2e/run-e2e.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/apm/e2e/run-e2e.sh b/x-pack/plugins/apm/e2e/run-e2e.sh index 28acd0e63a34a..85ab67bbf9a10 100755 --- a/x-pack/plugins/apm/e2e/run-e2e.sh +++ b/x-pack/plugins/apm/e2e/run-e2e.sh @@ -20,9 +20,8 @@ normal=$(tput sgr0) E2E_DIR="${0%/*}" TMP_DIR="tmp" APM_IT_DIR="tmp/apm-integration-testing" -KIBANA_DIR="${E2E_DIR}/../../../.." -WAIT_ON_BIN=$(yarn --cwd ${KIBANA_DIR} bin wait-on) -CYPRESS_BIN=$(yarn --cwd ${KIBANA_DIR} bin cypress) +WAIT_ON_BIN="../../../../node_modules/.bin/wait-on" +CYPRESS_BIN="../../../../node_modules/.bin/cypress" cd ${E2E_DIR}