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

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

Merged
merged 15 commits into from Sep 6, 2019
Merged

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

merged 15 commits into from Sep 6, 2019

Conversation

yannickcr
Copy link
Contributor

@yannickcr yannickcr commented Aug 12, 2019

Summary

To improve InstantSearch releases reliability we plan to add some End-2-End tests in addition to our existing unit test suite.

Based on #4030, this PR integrates this test suite to InstantSearch.js.

This PR makes the following changes:

  • Add algolia/instantsearch-e2-tests as devDependency (since I'm not sure we want to publish it on npm I link to the GitHub repository).
  • Add algolia/instantsearch-e2-tests peerDependencies.
  • Add 2 WebdriverIO configurations: one to run tests locally and one to run them on Sauce Labs.
  • Add .env file to .gitignore so you can use it to store Sauce Labs credentials (see https://github.com/algolia/instantsearch-e2e-tests#credentials ).
  • Add npm scripts to run End-2-End tests:
    • test:e2e: Alias for test:e2e:local.
    • test:e2e:local: Run the test suite on Chrome browser on your local machine.
    • test:e2e:saucelabs: Run the test suite on multiple browsers on the Sauce Labs service.
  • Update CircleCI configuration to run the new test_e2e task.
  • Update examples to use cp instead of rsync (which is unavailable on CircleCI).

@yannickcr yannickcr force-pushed the test/e2e branch 2 times, most recently from 13cc618 to 7e7edcc Compare August 19, 2019 12:50
There is a bug in 5.12.1 that prevent the process to end correctly webdriverio/webdriverio#4368
We can also not update to v5.12.0 because of webdriverio/webdriverio#4356
Copy link
Contributor

@Haroenv Haroenv left a comment

Choose a reason for hiding this comment

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

  • looks like storybook is built for e2e, doesn't seem necessary.
  • logs contain "RUNNING", which likely isn't useful on CI?
  • looks like we're only testing on windows? I guess fine for now

wdio.local.conf.js Outdated Show resolved Hide resolved
wdio.saucelabs.conf.js Outdated Show resolved Hide resolved
Co-Authored-By: Haroen Viaene <hello@haroen.me>
@yannickcr
Copy link
Contributor Author

yannickcr commented Aug 19, 2019

looks like storybook is built for e2e, doesn't seem necessary.

I used the website:build script that also build storybook for Netlify deployment. I can update this to only build storybook for Netlify.

logs contain "RUNNING", which likely isn't useful on CI?

It depends, since the tests can be long to run it can be good to see when they started in the logs. Also there is no option to suppress this in WebdriverIO (still displayed even with logLevel set to silent)

looks like we're only testing on windows? I guess fine for now

No objections to test on multiple platforms but multiplying the browser/platform combinations can seriously lengthen test time so we should choose carefully what to test.

Right now one test take ~30sec, and we can run 5 tests in parallel on SauceLabs

// x = number of tests
// y = number of browser/platform combinations
// the result is the number of minutes to run the e2e test suite
Math.ceil((x * y) / 5) * 0.5

Copy link
Member

@francoischalifour francoischalifour left a comment

Choose a reason for hiding this comment

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

Netlify deployment is not triggered but from the configuration, it should work.

@francoischalifour
Copy link
Member

looks like we're only testing on windows? I guess fine for now

I think that's the best minimal effort that we can do now because we use both macOS and Linux on the team, but not Windows. If it doesn't add too much overhead, we can add other platforms.

@yannickcr yannickcr changed the base branch from chore/demo-local-is to master August 21, 2019 11:06
@yannickcr yannickcr changed the base branch from master to develop August 21, 2019 11:06
@rarkins
Copy link

rarkins commented Aug 30, 2019

@Haroenv yes, Renovate will update this type of reference. Example: renovate-tests/npm8#2

@yannickcr
Copy link
Contributor Author

Great! Thank you @rarkins 👍

package.json Outdated Show resolved Hide resolved
package.json Outdated
@@ -80,6 +83,13 @@
"@types/storybook__addon-actions": "^3.4.2",
"@typescript-eslint/eslint-plugin": "1.13.0",
"@typescript-eslint/parser": "1.13.0",
"@wdio/cli": "5.11.14",
Copy link
Contributor

Choose a reason for hiding this comment

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

could theses be subdependencies of instantsearch-e2e-tests#v1.1.0 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They could be, but I choose to put them as peerDependencies since the wdio command will be run from instantsearch.js. Also it gives us more control having them as top dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants