From 137ea783eac79d69f20c1ea510c9c334e8cc779b Mon Sep 17 00:00:00 2001 From: Andrew Nicolaou Date: Fri, 24 May 2019 18:16:15 +0200 Subject: [PATCH] Experiment with "Checks" in Travis output (#1081) * Run tests on CI * Create a lint error on purpose * Splits build into test and deploy stages lint and test jobs will run in parallel and if both are successful (and branch is master), deploy will run. * Revert "Create a lint error on purpose" This reverts commit 306c91c4278631fa1c1dcd40f0b23f7f9e5f000d. * Updating snapshot * Run deploy only on master branch (not PRs) * Use global deploy config item to avoid building on PRs --- .travis.yml | 11 ++- .../__test__/__snapshots__/Nav.test.jsx.snap | 88 ++----------------- package.json | 2 +- 3 files changed, 14 insertions(+), 87 deletions(-) diff --git a/.travis.yml b/.travis.yml index ee7085c6..3de6635a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,8 +16,14 @@ before_install: install: true -script: - - docker-compose exec -T app npm run test:ci --verbose +jobs: + include: + - stage: test + name: "Linting" + script: docker-compose exec -T app npm run lint + - # stage name not required, will continue to use `test` + name: "Tests" + script: docker-compose exec -T app npm run test before_deploy: - docker-compose stop @@ -26,7 +32,6 @@ before_deploy: - gcloud --quiet version - gcloud --quiet components update - gcloud --quiet components update kubectl - deploy: - provider: script script: ./deploy.sh diff --git a/client/components/__test__/__snapshots__/Nav.test.jsx.snap b/client/components/__test__/__snapshots__/Nav.test.jsx.snap index 9e8143bf..19ecb479 100644 --- a/client/components/__test__/__snapshots__/Nav.test.jsx.snap +++ b/client/components/__test__/__snapshots__/Nav.test.jsx.snap @@ -13,7 +13,7 @@ exports[`Nav renders correctly 1`] = ` className="nav__item-logo" >
  • -
  • @@ -112,6 +102,7 @@ exports[`Nav renders correctly 1`] = ` onBlur={[Function]} onClick={[Function]} onFocus={[Function]} + onMouseOver={[Function]} > -
  • @@ -215,6 +195,7 @@ exports[`Nav renders correctly 1`] = ` onBlur={[Function]} onClick={[Function]} onFocus={[Function]} + onMouseOver={[Function]} > -
  • @@ -297,44 +267,6 @@ exports[`Nav renders correctly 1`] = `
  • -
  • - -
  • -
  • - -
  • -
  • diff --git a/package.json b/package.json index 1c0a5d4f..c845c959 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "build:server": "cross-env NODE_ENV=production webpack --config webpack/config.server.js", "build:examples": "cross-env NODE_ENV=production webpack --config webpack/config.examples.js", "test": "jest", - "test:ci": "npm run lint", + "test:ci": "npm run lint && npm run test", "fetch-examples": "cross-env NODE_ENV=development node ./server/scripts/fetch-examples.js", "fetch-examples-gg": "cross-env NODE_ENV=development node ./server/scripts/fetch-examples-gg.js", "fetch-examples-ml5": "cross-env NODE_ENV=development node ./server/scripts/fetch-examples-ml5.js",