From dffd585a051551d2696ed64d97c087d24e152822 Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Fri, 8 Jan 2021 22:22:26 -0500 Subject: [PATCH] update integration runner to output logs on failure Signed-off-by: Sebastian Malton --- .azure-pipelines.yml | 6 +++--- Makefile | 14 +------------- package.json | 5 ++++- scripts/integration.sh | 28 ++++++++++++++++++++++++++++ 4 files changed, 36 insertions(+), 17 deletions(-) create mode 100755 scripts/integration.sh diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index 009418b1c0..623c4d3395 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -37,7 +37,7 @@ jobs: displayName: Cache Yarn packages - script: make install-deps displayName: Install dependencies - - script: make integration-win + - script: yarn integration:win displayName: Run integration tests - script: make build condition: "and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))" @@ -76,7 +76,7 @@ jobs: displayName: Install dependencies - script: make test displayName: Run tests - - script: make integration-mac + - script: yarn integration:mac displayName: Run integration tests - script: make build condition: "and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))" @@ -132,7 +132,7 @@ jobs: # Although the kube and minikube config files are in placed $HOME they are owned by root sudo chown -R $USER $HOME/.kube $HOME/.minikube displayName: Install integration test dependencies - - script: xvfb-run --auto-servernum --server-args='-screen 0, 1600x900x24' make integration-linux + - script: xvfb-run --auto-servernum --server-args='-screen 0, 1600x900x24' yarn integration:linux displayName: Run integration tests - bash: | sudo chown root:root / diff --git a/Makefile b/Makefile index e492aa012c..a997542e5c 100644 --- a/Makefile +++ b/Makefile @@ -31,18 +31,6 @@ lint: test: download-bins yarn test -integration-linux: - yarn build:linux - yarn integration - -integration-mac: - yarn build:mac - yarn integration - -integration-win: - yarn build:win - yarn integration - test-app: yarn test @@ -62,4 +50,4 @@ else rm -rf binaries/client/* rm -rf dist/* rm -rf static/build/* -endif \ No newline at end of file +endif diff --git a/package.json b/package.json index 84e24c88bd..6309d5a0c7 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,10 @@ "build:mac": "yarn compile && electron-builder --mac --dir -c.productName=Lens", "build:win": "yarn compile && electron-builder --win --dir -c.productName=Lens", "test": "jest --env=jsdom src $@", - "integration": "jest --coverage integration $@", + "integration-runner": "jest --coverage integration $@", + "integration:linux": "scripts/integration.sh linux", + "integration:mac": "scripts/integration.sh mac", + "integration:win": "scripts/integration.sh win", "dist": "yarn compile && electron-builder --publish onTag", "dist:win": "yarn compile && electron-builder --publish onTag --x64 --ia32", "dist:dir": "yarn dist --dir -c.compression=store -c.mac.identity=null", diff --git a/scripts/integration.sh b/scripts/integration.sh new file mode 100755 index 0000000000..aa6510aaba --- /dev/null +++ b/scripts/integration.sh @@ -0,0 +1,28 @@ +case $1 in + mac) + find ~/Library/Logs/Lens -type file -name *.log -delete + ;; + linux) + find ~/.config/Lens -type file -name *.log -delete + ;; + win) + find %APPDATA%/Lens -type file -name *.log -delete + ;; +esac + +yarn build:$1 +DEBUG=true yarn integration-runner + +if [ $? -ne 0 ]; then + case $1 in + mac) + find ~/Library/Logs/Lens -type file -name *.log -exec cat {} \; + ;; + linux) + find ~/.config/Lens -type file -name *.log -exec cat {} \; + ;; + win) + find %APPDATA%/Lens -type file -name *.log -exec cat {} \; + ;; + esac +fi