diff --git a/.circleci/config.yml b/.circleci/config.yml index b7eaa05a08a..0dc313ec893 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -240,6 +240,8 @@ jobs: - run: name: frontend tests command: './scripts/circle-test-frontend.sh' + - store_test_results: + path: reports/junit - run: name: ci job failed command: './scripts/ci-job-failed.sh' diff --git a/.gitignore b/.gitignore index 15587c08f5c..65cafd94694 100644 --- a/.gitignore +++ b/.gitignore @@ -10,13 +10,12 @@ awsconfig /public/views/index.html /public/views/error.html /emails/dist +/reports # Enterprise emails /emails/templates/enterprise_* /public/emails/enterprise_* -/public_gen -/public/vendor/npm /tmp tools/phantomjs/phantomjs tools/phantomjs/phantomjs.exe diff --git a/package.json b/package.json index 5f4cbf94f00..dfd9ac621ab 100644 --- a/package.json +++ b/package.json @@ -161,7 +161,8 @@ "typecheck": "tsc --noEmit", "typecheckPackages": "yarn workspaces run typecheck", "jest": "jest --notify --watch", - "e2e": "cd packages/grafana-e2e && yarn start --env BASE_URL=$BASE_URL,CIRCLE_SHA1=$CIRCLE_SHA1,SLOWMO=$SLOWMO --config integrationFolder=../../public/e2e-tests/integration,screenshotsFolder=../../public/e2e-tests/screenShots,fileServerFolder=./cypress,video=false,viewportWidth=1920,viewportHeight=1080,trashAssetsBeforeRuns=false", + "jest-ci": "mkdir -p reports/junit && export JEST_JUNIT_OUTPUT_DIR=reports/junit && jest --ci --reporters=default --reporters=jest-junit --maxWorkers 2", + "e2e": "cd packages/grafana-e2e && yarn start --env BASE_URL=$BASE_URL,CIRCLE_SHA2=$CIRCLE_SHA2,SLOWMO=$SLOWMO --config integrationFolder=../../public/e2e-tests/integration,screenshotsFolder=../../public/e2e-tests/screenShots,fileServerFolder=./cypress,video=false,viewportWidth=1920,viewportHeight=1080,trashAssetsBeforeRuns=false", "e2e-tests": "yarn e2e", "e2e-tests:debug": "SLOWMO=1 yarn e2e --headed --no-exit", "api-tests": "jest --notify --watch --config=devenv/e2e-api-tests/jest.js", diff --git a/scripts/grunt/options/exec.js b/scripts/grunt/options/exec.js index 3296abecfd4..0acb2cd661c 100644 --- a/scripts/grunt/options/exec.js +++ b/scripts/grunt/options/exec.js @@ -18,7 +18,7 @@ module.exports = function(config, grunt) { command: 'yarn run typecheck', src: ['public/app/**/*.ts*'], }, - jest: 'node ./node_modules/jest-cli/bin/jest.js --maxWorkers 2', + jest: 'yarn run jest-ci', webpack: 'node ./node_modules/webpack/bin/webpack.js --config scripts/webpack/webpack.prod.js', }; diff --git a/yarn.lock b/yarn.lock index a96b7d03de0..2f12967ea53 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6560,6 +6560,11 @@ caniuse-api@^3.0.0: lodash.memoize "^4.1.2" lodash.uniq "^4.5.0" +caniuse-db@1.0.30000772: + version "1.0.30000772" + resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000772.tgz#51aae891768286eade4a3d8319ea76d6a01b512b" + integrity sha1-UarokXaChureSj2DGep21qAbUSs= + caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000939, caniuse-lite@^1.0.30000947, caniuse-lite@^1.0.30000989, caniuse-lite@^1.0.30000999: version "1.0.30000999" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000999.tgz#427253a69ad7bea4aa8d8345687b8eec51ca0e43" @@ -12840,6 +12845,17 @@ jest-jasmine2@^24.9.0: pretty-format "^24.9.0" throat "^4.0.0" +jest-junit@^10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/jest-junit/-/jest-junit-10.0.0.tgz#c94b91c24920a327c9d2a075e897b2dba4af494b" + integrity sha512-dbOVRyxHprdSpwSAR9/YshLwmnwf+RSl5hf0kCGlhAcEeZY9aRqo4oNmaT0tLC16Zy9D0zekDjWkjHGjXlglaQ== + dependencies: + jest-validate "^24.9.0" + mkdirp "^0.5.1" + strip-ansi "^5.2.0" + uuid "^3.3.3" + xml "^1.0.1" + jest-junit@^6.4.0: version "6.4.0" resolved "https://registry.yarnpkg.com/jest-junit/-/jest-junit-6.4.0.tgz#23e15c979fa6338afde46f2d2ac2a6b7e8cf0d9e" @@ -21877,7 +21893,7 @@ utils-merge@1.0.1: resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= -uuid@^3.0.1, uuid@^3.1.0, uuid@^3.3.2: +uuid@^3.0.1, uuid@^3.1.0, uuid@^3.3.2, uuid@^3.3.3: version "3.3.3" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.3.tgz#4568f0216e78760ee1dbf3a4d2cf53e224112866" integrity sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==