Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(test): store junit results for e2e tests #4788

Merged
merged 11 commits into from
Jun 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
name: Unit tests
command: yarn run test --maxWorkers=4
- store_test_results:
path: junit/jest/
path: junit/jest/

'e2e tests':
<<: *defaults
Expand All @@ -95,11 +95,14 @@ jobs:
- restore_cache: *restore_yarn_cache
- run: *run_yarn_install
- save_cache: *save_yarn_cache
- run:
name: Build example
command: yarn run website:build e-commerce
- run:
name: End-2-End tests
command: |
yarn run website:build
yarn run test:e2e:saucelabs
command: yarn run test:e2e:saucelabs
- store_test_results:
path: junit/wdio/

'release if needed':
<<: *defaults
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
"@typescript-eslint/parser": "4.15.1",
"@wdio/cli": "5.16.9",
"@wdio/jasmine-framework": "5.16.5",
"@wdio/junit-reporter": "5.16.11",
"@wdio/local-runner": "5.16.9",
"@wdio/sauce-service": "5.16.5",
"@wdio/selenium-standalone-service": "5.16.5",
Expand Down
29 changes: 22 additions & 7 deletions scripts/website/build-examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,26 @@ set -e # exit when error
rm -rf website/examples
mkdir website/examples

for example in examples/*; do
if [ -d "$example" ]; then
name=$(basename "$example")
echo "Building $name example..."
build_example() {
example=$1
name=$(basename "$example")

(cd "$example" && yarn && yarn build && cp -r "dist/" "../../website/examples/$name/")
fi
done
echo "Building $name example..."

(
cd "$example" &&
yarn &&
yarn build &&
cp -r "dist/" "../../website/examples/$name/"
)
}

if [ -z "$1" ]; then
for example in examples/*; do
if [ -d "$example" ]; then
build_example $example
fi
done
else
build_example examples/$1
fi
20 changes: 19 additions & 1 deletion wdio.saucelabs.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,22 @@

const { saucelabs } = require('instantsearch-e2e-tests');

exports.config = saucelabs;
exports.config = {
...saucelabs,
reporters: [
'spec',
[
'junit',
{
outputDir: `${__dirname}/junit/wdio`,
outputFileFormat({
cid,
capabilities: { browserName, browserVersion },
}) {
return `results-${cid}.${browserName}-${browserVersion}.xml`;
},
addFileAttribute: true,
},
],
],
};
35 changes: 35 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3115,6 +3115,16 @@
"@wdio/utils" "5.16.5"
jasmine "^3.5.0"

"@wdio/junit-reporter@5.16.11":
version "5.16.11"
resolved "https://registry.yarnpkg.com/@wdio/junit-reporter/-/junit-reporter-5.16.11.tgz#70c2dd83fd669783de233bd2c386faa4c0d60de2"
integrity sha512-Jslnz1Iijho+AwIAwlYHYEqI7fEqvom7P+MvZ2F8Y2r94ui0VzR14B9iOlGr4D6PvWv0/NnZ+othfTzUTL0j5Q==
dependencies:
"@wdio/reporter" "5.15.2"
json-stringify-safe "^5.0.1"
junit-report-builder "^1.3.0"
validator "^12.0.0"

"@wdio/local-runner@5.16.9":
version "5.16.9"
resolved "https://registry.yarnpkg.com/@wdio/local-runner/-/local-runner-5.16.9.tgz#87111a5a6ade418326da237d802ed135efb975d3"
Expand Down Expand Up @@ -5996,6 +6006,11 @@ data-urls@^2.0.0:
whatwg-mimetype "^2.3.0"
whatwg-url "^8.0.0"

date-format@0.0.2:
version "0.0.2"
resolved "https://registry.yarnpkg.com/date-format/-/date-format-0.0.2.tgz#fafd448f72115ef1e2b739155ae92f2be6c28dd1"
integrity sha1-+v1Ej3IRXvHitzkVWukvK+bCjdE=

date-now@^0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b"
Expand Down Expand Up @@ -9742,6 +9757,16 @@ jsx-ast-utils@^2.2.3:
array-includes "^3.0.3"
object.assign "^4.1.0"

junit-report-builder@^1.3.0:
version "1.3.3"
resolved "https://registry.yarnpkg.com/junit-report-builder/-/junit-report-builder-1.3.3.tgz#a848e9ef1b1664b855d1abf8766c39f0a9c5ff33"
integrity sha512-75bwaXjP/3ogyzOSkkcshXGG7z74edkJjgTZlJGAyzxlOHaguexM3VLG6JyD9ZBF8mlpgsUPB1sIWU4LISgeJw==
dependencies:
date-format "0.0.2"
lodash "^4.17.15"
mkdirp "^0.5.0"
xmlbuilder "^10.0.0"

kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0:
version "3.2.2"
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64"
Expand Down Expand Up @@ -14826,6 +14851,11 @@ validate-npm-package-license@^3.0.1:
spdx-correct "^3.0.0"
spdx-expression-parse "^3.0.0"

validator@^12.0.0:
version "12.2.0"
resolved "https://registry.yarnpkg.com/validator/-/validator-12.2.0.tgz#660d47e96267033fd070096c3b1a6f2db4380a0a"
integrity sha512-jJfE/DW6tIK1Ek8nCfNFqt8Wb3nzMoAbocBF6/Icgg1ZFSBpObdnwVY2jQj6qUqzhx5jc71fpvBWyLGO7Xl+nQ==

validator@^8.0.0:
version "8.2.0"
resolved "https://registry.yarnpkg.com/validator/-/validator-8.2.0.tgz#3c1237290e37092355344fef78c231249dab77b9"
Expand Down Expand Up @@ -15272,6 +15302,11 @@ xml@^1.0.1:
resolved "https://registry.yarnpkg.com/xml/-/xml-1.0.1.tgz#78ba72020029c5bc87b8a81a3cfcd74b4a2fc1e5"
integrity sha1-eLpyAgApxbyHuKgaPPzXS0ovweU=

xmlbuilder@^10.0.0:
version "10.1.1"
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-10.1.1.tgz#8cae6688cc9b38d850b7c8d3c0a4161dcaf475b0"
integrity sha512-OyzrcFLL/nb6fMGHbiRDuPup9ljBycsdCypwuyg5AAHvyWzGfChJpCXMG88AGTIMFhGZ9RccFN1e6lhg3hkwKg==

xmlchars@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb"
Expand Down