-
Notifications
You must be signed in to change notification settings - Fork 121
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
Modernize & cleanup #72
Conversation
Looks like saucelabs credentials need updated in |
export SAUCE_USERNAME=username | ||
export SAUCE_ACCESS_KEY=key | ||
sauce_username: my_awesome_username | ||
sauce_key: 550e8400-e29b-41d4-a716-446655440000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't a real key, is it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the key comes from .zuulrc
, which is not included in the repo, and not encrypted - how do we run the sauce labs tests on Travis?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't a real key, is it?
Nope. Just a random number. I should make that more clear. Copied and pasted from the Zuul wiki.
If the key comes from .zuulrc, which is not included in the repo, and not encrypted - how do we run the sauce labs tests on Travis?
.zuulrc
is for contributors who want to run the tests in their own saucelabs account.
For running tests from travis you should store encrypted environment variables following these instructions: https://github.com/defunctzombie/zuul/wiki/Travis-ci
I had assumed the current encrypted env variables in the .travis.yml
were for Saucelabs, but seems like they are no longer valid. If you like I could try and set up a saucelabs account for this, unless you already have one. Saucelabs requires a separate account for each opensource project for their free tier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a Sauce Labs account for this, but as I mentioned in the notes below, it doesn't work for forked PRs.
@@ -0,0 +1,12 @@ | |||
var pad = require('./pad.js'); | |||
|
|||
var env = typeof window === 'object' ? window : self; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is self
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self
is a reference to the global scope (equivalent to window
) in WebWorkers and ServiceWorkers: https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/self
I looked at a couple of modules designed to work in both a browser context and in WebWorkers and this was the pattern they use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. TIL.
Can you add tests for Web Workers and Service Workers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about node?
node
> self
ReferenceError: self is not defined
> window
ReferenceError: window is not defined
> global
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about this point? Was this resolved? I get a
var env = typeof window === 'object' ? window : self;
^
ReferenceError: self is not defined
in node; any suggestions??
Notes:
|
Just reading through this. It's likely that the encrypted variables in the current |
Any chance we can get a zuul test for the Web Worker/Service Worker fix? |
I'm not sure this test actually works. I'm not sure whether the TAP output from the worker thread gets back to zuul so that it can confirm the tests are run. This does run the test in a worker, I'm just not sure about how to handle output. I've never run tests in a worker before. |
A little further info: When I run zuul locally and run |
What do we need to do to get these checks passing so we can close all those open issues? |
Thanks for following up on this. The tests are currently failing because of failing saucelab credentials, because this is a PR from a different repo. The only way to fix this it to merge this PR into this repo so that the tests can run with the correct credentials. I suggest merging this PR into a new branch here, checking the tests pass, then merging into master. The one thing missing is that I don't think the tests for this working in a webworker are actually working - i.e. if the tests fail in a webworker I don't think this currently cause the test output to show failure. However, this PR has better test coverage than the current version even without this. |
@ericelliott any update on this? :) |
@nealoke @gmaclennan I've invited both of you as collaborators. Feel free to do what you need to do in order to get the tests passing on the main repo. |
@ericelliott thanks but i'm not really familiar with the CI tools :( When I have time i'll dive into this! |
I put a few hours into trying to get this to work with SauceLabs and have not been able to get consistent results. Would it suffice to run the Karma tests on Chrome Headless (v60) and forget the other browsers? Or perhaps try a different testing service? These are the errors I am seeing:
|
@MarkHerhold I believe you can adjust the timeout. I'd prefer to make sure it works in IE11, because it currently still holds about 13% market share... |
I think I'd be OK with running the tests in Chrome headless for now just to get this back on track. We could release it as a breaking change, just to be on the safe side. However, I'd want somebody to test it in IE11 and at least spot check it for us... Do you happen to have IE11 available? |
@ericelliott I've increased the timeout to 120 seconds (see this commit on my fork) and set retries to two and still have flaky results. Everyone can download an IE11 VM (and other versions) here. I checked IE11 manually and the build does indeed work (tested cuid.js). I will work on getting Chrome Headless working on Travis CI. |
Looking great. Thanks! |
Published as v2.0.1 |
Should fix #40 #41 #42 #54 #59 #65 #68
This is based upon the original source code and api from
v1.2.5
. This is the same code that is published in the latestv1.3.8
.I don't know webpack, but this should work fine webpack if you use that, would be great if someone could test it.
I have kept the API from
v1.2.5
and code logic is largely the same, the changes are mainly to restructure the code as commonJS modules, and update code formatting (to match the latest.eslintrc
in the project (with changes to work with the latest eslint v3.9.1). The code changes are:self
ifwindow
is undefined.react-native
which apparently does not haveuserAgent
ormimeTypes
defined. This id does not probably change much between clients, so we should have something with better entropy.I threw away many of the changes in master, which used ES2016 and required a complicated build process with transforms etc. The project should now be a lot simpler.
Browser builds rely on the
browser
field inpackage.json
which is supported by both browserify and webpack.Standalone UMD builds are created in
dist
which is excluded from the git repo but included in npm, so that they will be available from https://unpkg.com/cuid/dist/cuid.js https://unpkg.com/cuid/dist/cuid.min.js once this package is published to npm. The build script runs as a prepublish script, so it should require nothing more thannpm publish
.Tests are running and passing locally and on saucelabs. Hopefully travis-ci should just work.
Finally, sorry about the lack of commit messages, but the repo seemed to have drifted a lot from the last published version and there was no logical step-by-step development from the current
master
.