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

Switch test suite from PhantomJS to Karma #626

Merged
merged 22 commits into from May 25, 2018
Merged

Switch test suite from PhantomJS to Karma #626

merged 22 commits into from May 25, 2018

Conversation

mislav
Copy link
Contributor

@mislav mislav commented May 24, 2018

npm t now runs the test suite in headless Chrome/Firefox.

With npm run karma, additional browsers may be connected to the Karma runner and automatically re-run tests when files change.

mislav added 12 commits May 24, 2018 00:12
Chrome and Firefox both split `append`d values with `, `.
`signal.listeners` is not available in native implementations of AbortSignal.
Safari aggressively caches `/slow` endpoint after first load and serves
it up really fast on subsequent runs, not giving it enough time to
invoke `controller.abort()`.

Adding `Cache-Control` response headers from the server doesn't work.
Safari still serves `/slow` from disk cache, even though `/slow` was
never even allowed to finish on prior runs. My guess is that Safari
erroneously caches the result of `/slow` when the initial request was
aborted.
Just like in Chrome, this isn't supported natively.
@mislav mislav requested a review from a team May 24, 2018 01:07
.travis.yml Outdated
chrome: stable
before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start

Choose a reason for hiding this comment

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

Do we still need xfvb if we are using a headless version of Firefox/Chrome?

Choose a reason for hiding this comment

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

I believe so

Copy link

@koddsson koddsson May 24, 2018

Choose a reason for hiding this comment

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

I looked it up and developers.google.com says:

So I still need Xvfb?

No. Headless Chrome doesn't use a window so a display server like Xvfb is no longer needed. You can happily run your automated tests without it.

What is Xvfb? Xvfb is an in-memory display server for Unix-like systems that enables you to run graphical applications (like Chrome) without an attached physical display. Many people use Xvfb to run earlier versions of Chrome to do "headless" testing.

Choose a reason for hiding this comment

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

We still have it in https://github.com/chaijs/type-detect/blob/master/.travis.yml and I cannot remember why, but I'm sure I would have removed it if it was no longer needed. Perhaps Firefox still needs it? I'd be happy to be wrong though 😛

Choose a reason for hiding this comment

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

I think the headless browsers will work without xvfb. It should be easy enough to test 😄

Choose a reason for hiding this comment

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

I made a PR to remove that pre-test step in type-detect and it's running 🍏

Choose a reason for hiding this comment

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

Thanks for the PR @koddsson. Consider me happily wrong. Let's get rid of these lines here too!

Copy link
Contributor

@dgraham dgraham left a comment

Choose a reason for hiding this comment

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

❤️

@@ -2,9 +2,12 @@ sudo: false
language: node_js
node_js:
- "node"
dist: trusty
Copy link
Contributor

Choose a reason for hiding this comment

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

Trusty is the default test environment now, so we don't need to specify it here.

I've needed sudo: true for Chrome headless to work in the past. That issue may be fixed now, though.

@mislav mislav merged commit 141665b into master May 25, 2018
@mislav mislav deleted the karma branch May 25, 2018 16:39
This was referenced May 25, 2018
MattiasBuelens added a commit to MattiasBuelens/yetch that referenced this pull request Jul 5, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants