Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

test: add End-2-End test suite #2824

Merged
merged 4 commits into from
Sep 17, 2019
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
21 changes: 18 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
name: Unit Tests
command: yarn test --maxWorkers=4

test_e2e:
test_integration:
<<: *defaults
docker:
- image: circleci/node:8.16.1-browsers@sha256:e2f01766ecc1e133ca4873b7a0fa292da2d39e756783f6a7f90d4d5c2a59ccb7
Expand All @@ -68,8 +68,22 @@ jobs:
- run: *run_yarn_install
- save_cache: *save_yarn_cache
- run:
name: E2E Tests
command: yarn test:e2e
name: Integration Tests
command: yarn test:integration

test_e2e:
<<: *defaults
steps:
- checkout
- run: *install_yarn_version
- restore_cache: *restore_yarn_cache
- run: *run_yarn_install
- save_cache: *save_yarn_cache
- run:
name: End-2-End tests
command: |
yarn run website:build
yarn run test:e2e:saucelabs
samouss marked this conversation as resolved.
Show resolved Hide resolved

test_examples:
<<: *defaults
Expand All @@ -89,5 +103,6 @@ workflows:
jobs:
- test_build
- test_unit
- test_integration
- test_e2e
- test_examples
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ dist/
build/
*.log
.DS_Store
.env
.eslintcache
.idea/
*.iml
Expand Down
13 changes: 12 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
"type-check:watch": "yarn type-check --watch",
"test": "yarn jest",
"test:watch": "yarn jest --watch",
"test:e2e": "NODE_ENV=development yarn test:regressions && yarn test:argos",
"test:e2e": "yarn test:e2e:local",
"test:e2e:local": "wdio wdio.local.conf.js",
"test:e2e:saucelabs": "wdio wdio.saucelabs.conf.js",
"test:integration": "NODE_ENV=development yarn test:regressions && yarn test:argos",
"test:examples": "node scripts/test-examples.js",
"test:build": "yarn build && yarn test:size",
"test:regressions": "webpack --config integration/webpack.config.js && node integration/runTest.js",
Expand Down Expand Up @@ -60,6 +63,13 @@
"@types/storybook__react": "^4.0.0",
"@typescript-eslint/eslint-plugin": "2.2.0",
"@typescript-eslint/parser": "2.2.0",
"@wdio/cli": "5.11.14",
"@wdio/jasmine-framework": "5.12.1",
"@wdio/local-runner": "5.12.1",
"@wdio/sauce-service": "5.12.1",
"@wdio/selenium-standalone-service": "5.12.1",
"@wdio/spec-reporter": "5.12.1",
"@wdio/static-server-service": "5.12.1",
Copy link
Contributor

@tkrugg tkrugg Sep 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I asked this question already but I'm no longer sure what's the answer.
Is it not possible to hide this away in instantsearch-e2e-tests and just expose a command there?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my answer: algolia/instantsearch#4035 (comment)
(it can be discussed of course 😉)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also think we should hide this

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would also make sense to me.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well... I'm not for this.

First of all there is very few advantages (if any?) to "hide" dependencies but the real problem is mainly that it will makes us call a subdependency from the parent project (react-instantsearch calls wdio directly), which is not recommenced (the package version we're targeting may not be at the node_modules top level, depending how npm/yarn deduplicated the dependencies).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we also hide wdio call then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would be the objective of hiding these dependencies?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would remove the overall perceived complexity, as well as reduce the noise and cognitive overhead of managing these dependencies.

I find it surprising that we went all the way to packaging the E2E tests (e.g. see also wdio.saucelabs.conf.js which only exports the E2E package import), but are reluctant to hide the dependencies themself.

The E2E test suite would be more predictable if the wdio dependencies are packaged within it. Here, we are responsible for the wdio deps to work with a black-boxed test suite, which is quite contradictory.

"algoliasearch": "3.33.0",
"argos-cli": "0.1.1",
"babel-eslint": "10.0.2",
Expand All @@ -85,6 +95,7 @@
"file-loader": "4.2.0",
"glob": "7.1.4",
"html-webpack-plugin": "3.2.0",
"instantsearch-e2e-tests": "algolia/instantsearch-e2e-tests#v1.2.2",
"instantsearch.css": "7.3.1",
"jest": "24.9.0",
"jest-watch-typeahead": "0.4.0",
Expand Down
5 changes: 5 additions & 0 deletions wdio.local.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* eslint-disable import/no-commonjs */

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

exports.config = local;
5 changes: 5 additions & 0 deletions wdio.saucelabs.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* eslint-disable import/no-commonjs */

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

exports.config = saucelabs;
Loading