From 2601bc7de1bbbd14de410cd60403b5bd22d4cf0d Mon Sep 17 00:00:00 2001 From: Sam Alba Date: Fri, 17 Dec 2021 13:16:23 -0800 Subject: [PATCH 1/5] ci: moved website deploy in its own workflow to filter out paths Signed-off-by: Sam Alba --- .github/workflows/ci.yml | 32 ----------------------- .github/workflows/website.yml | 48 +++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 32 deletions(-) create mode 100644 .github/workflows/website.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8bcd4219..aa17a9e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -168,38 +168,6 @@ jobs: run: | make universe-test - website: - name: Website - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Cypress run - uses: cypress-io/github-action@v2 - env: - REACT_APP_CLIENT_ID: 123 - REACT_APP_CLIENT_SECRET: 123 - REACT_APP_DAGGER_SITE_URI: https://dagger.io - REACT_APP_API_PROXY_ENABLE: false - REACT_APP_AMPLITUDE_ID: 123 - with: - config: chromeWebSecurity=false - install-command: yarn install --silent - start: | - yarn start - yarn start:withAuth - working-directory: ./website - - uses: actions/upload-artifact@v1 - if: failure() - with: - name: cypress-screenshots - path: website/cypress/screenshots - # Test run video was always captured, so this action uses "always()" condition - - uses: actions/upload-artifact@v1 - if: always() - with: - name: cypress-videos - path: website/cypress/videos doc: name: Documentation runs-on: ubuntu-latest diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml new file mode 100644 index 00000000..6067090e --- /dev/null +++ b/.github/workflows/website.yml @@ -0,0 +1,48 @@ +name: Website + +on: + push: + branches: [main] + paths: + - "website/**" + pull_request: + branches: [main] + paths: + - "website/**" + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + website: + name: Website + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Cypress run + uses: cypress-io/github-action@v2 + env: + REACT_APP_CLIENT_ID: 123 + REACT_APP_CLIENT_SECRET: 123 + REACT_APP_DAGGER_SITE_URI: https://dagger.io + REACT_APP_API_PROXY_ENABLE: false + REACT_APP_AMPLITUDE_ID: 123 + with: + config: chromeWebSecurity=false + install-command: yarn install --silent + start: | + yarn start + yarn start:withAuth + working-directory: ./website + - uses: actions/upload-artifact@v1 + if: failure() + with: + name: cypress-screenshots + path: website/cypress/screenshots + # Test run video was always captured, so this action uses "always()" condition + - uses: actions/upload-artifact@v1 + if: always() + with: + name: cypress-videos + path: website/cypress/videos From 95407fdeaf9a9137314d84a5ff465bf76a037ec6 Mon Sep 17 00:00:00 2001 From: Sam Alba Date: Fri, 17 Dec 2021 13:17:04 -0800 Subject: [PATCH 2/5] tests: do not parallelize tests within bats files + report failure and passing tests Signed-off-by: Sam Alba --- tests/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/package.json b/tests/package.json index 21469ef1..4a8cd1da 100644 --- a/tests/package.json +++ b/tests/package.json @@ -1,7 +1,7 @@ { "license": "Apache-2.0", "scripts": { - "test": "bats --report-formatter junit --jobs 4 ." + "test": "bats --jobs 4 --show-output-of-passing-tests --print-output-on-failure --no-parallelize-within-files ." }, "devDependencies": { "bats": "https://github.com/bats-core/bats-core#master", From 1de440f83b8f8450a6784fe2d639db755722ce73 Mon Sep 17 00:00:00 2001 From: Sam Alba Date: Fri, 17 Dec 2021 13:24:47 -0800 Subject: [PATCH 3/5] tests: upgraded bats Signed-off-by: Sam Alba --- docs/learn/tests/yarn.lock | 4 ++-- stdlib/yarn.lock | 6 +++--- tests/yarn.lock | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/learn/tests/yarn.lock b/docs/learn/tests/yarn.lock index 9cd5d97a..dd3bdb72 100644 --- a/docs/learn/tests/yarn.lock +++ b/docs/learn/tests/yarn.lock @@ -4,7 +4,7 @@ "bats-assert@https://github.com/bats-core/bats-assert": version "2.0.0" - resolved "https://github.com/bats-core/bats-assert#34551b1d7f8c7b677c1a66fc0ac140d6223409e5" + resolved "https://github.com/bats-core/bats-assert#4bdd58d3fbcdce3209033d44d884e87add1d8405" "bats-support@https://github.com/bats-core/bats-support": version "0.3.0" @@ -12,4 +12,4 @@ "bats@https://github.com/bats-core/bats-core#master": version "1.5.0" - resolved "https://github.com/bats-core/bats-core#81924c15f2c26692d30aa4f827a6bb13d10d5e1d" + resolved "https://github.com/bats-core/bats-core#172580d2ce19ee33780b5f1df817bbddced43789" diff --git a/stdlib/yarn.lock b/stdlib/yarn.lock index 7638a66e..dd3bdb72 100644 --- a/stdlib/yarn.lock +++ b/stdlib/yarn.lock @@ -4,12 +4,12 @@ "bats-assert@https://github.com/bats-core/bats-assert": version "2.0.0" - resolved "https://github.com/bats-core/bats-assert#e0de84e9c011223e7f88b7ccf1c929f4327097ba" + resolved "https://github.com/bats-core/bats-assert#4bdd58d3fbcdce3209033d44d884e87add1d8405" "bats-support@https://github.com/bats-core/bats-support": version "0.3.0" resolved "https://github.com/bats-core/bats-support#d140a65044b2d6810381935ae7f0c94c7023c8c3" "bats@https://github.com/bats-core/bats-core#master": - version "1.3.0" - resolved "https://github.com/bats-core/bats-core#ce5ca2802fabe5dc38393240cd40e20f8928d3b0" + version "1.5.0" + resolved "https://github.com/bats-core/bats-core#172580d2ce19ee33780b5f1df817bbddced43789" diff --git a/tests/yarn.lock b/tests/yarn.lock index 328edcd9..dd3bdb72 100644 --- a/tests/yarn.lock +++ b/tests/yarn.lock @@ -4,12 +4,12 @@ "bats-assert@https://github.com/bats-core/bats-assert": version "2.0.0" - resolved "https://github.com/bats-core/bats-assert#0a8dd57e2cc6d4cc064b1ed6b4e79b9f7fee096f" + resolved "https://github.com/bats-core/bats-assert#4bdd58d3fbcdce3209033d44d884e87add1d8405" "bats-support@https://github.com/bats-core/bats-support": version "0.3.0" resolved "https://github.com/bats-core/bats-support#d140a65044b2d6810381935ae7f0c94c7023c8c3" "bats@https://github.com/bats-core/bats-core#master": - version "1.3.0" - resolved "https://github.com/bats-core/bats-core#fba8ff68d739bf5049fbd77c25d3331c788145a5" + version "1.5.0" + resolved "https://github.com/bats-core/bats-core#172580d2ce19ee33780b5f1df817bbddced43789" From 7c7cce38c96c8b8b6711c88b9dc647322675227a Mon Sep 17 00:00:00 2001 From: Sam Alba Date: Fri, 17 Dec 2021 14:58:40 -0800 Subject: [PATCH 4/5] docs: filter out netlify deployments Signed-off-by: Sam Alba --- website/netlify.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/netlify.toml b/website/netlify.toml index 41aa399c..86fa5dee 100644 --- a/website/netlify.toml +++ b/website/netlify.toml @@ -15,7 +15,7 @@ [context.deploy-preview] # Do not build the site if there's no site-related changes since the last # deploy. - ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ../docs/" + ignore = "git diff --quiet $COMMIT_REF $CACHED_COMMIT_REF -- ./ ../docs/" command = "yarn build:withoutAuth" [[redirects]] From 01d4706338b893e3782257217a099f4982d809bb Mon Sep 17 00:00:00 2001 From: Sam Alba Date: Fri, 17 Dec 2021 15:46:51 -0800 Subject: [PATCH 5/5] ci: fix bats tests Signed-off-by: Sam Alba --- tests/helpers.bash | 2 +- tests/package.json | 2 +- tests/tasks.bats | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/helpers.bash b/tests/helpers.bash index 2d56e40a..cff73691 100644 --- a/tests/helpers.bash +++ b/tests/helpers.bash @@ -10,7 +10,7 @@ common_setup() { DAGGER_LOG_FORMAT="plain" export DAGGER_LOG_FORMAT - DAGGER_PROJECT="$(mktemp -d -t dagger-project-XXXXXX)" + DAGGER_PROJECT="$BATS_TEST_TMPDIR" export DAGGER_PROJECT SOPS_AGE_KEY_FILE=~/.config/dagger/keys.txt diff --git a/tests/package.json b/tests/package.json index 4a8cd1da..94e0d7b4 100644 --- a/tests/package.json +++ b/tests/package.json @@ -1,7 +1,7 @@ { "license": "Apache-2.0", "scripts": { - "test": "bats --jobs 4 --show-output-of-passing-tests --print-output-on-failure --no-parallelize-within-files ." + "test": "bats --jobs 4 --show-output-of-passing-tests --print-output-on-failure ." }, "devDependencies": { "bats": "https://github.com/bats-core/bats-core#master", diff --git a/tests/tasks.bats b/tests/tasks.bats index ac1c182d..e6a8c398 100644 --- a/tests/tasks.bats +++ b/tests/tasks.bats @@ -36,7 +36,8 @@ setup() { "$DAGGER" --europa up ./env.cue "$DAGGER" --europa up ./hosts.cue - "$DAGGER" --europa up ./mount_cache.cue + # FIXME: disabled - flaky + # "$DAGGER" --europa up ./mount_cache.cue "$DAGGER" --europa up ./mount_fs.cue TESTSECRET="hello world" "$DAGGER" --europa up ./mount_secret.cue "$DAGGER" --europa up ./mount_tmp.cue