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

chore: switch to videojs-generate-karma-config #5528

Merged
merged 10 commits into from Oct 31, 2018

Conversation

Projects
None yet
2 participants
@BrandonOCasey
Copy link
Contributor

BrandonOCasey commented Oct 25, 2018

Heavily simplifies a lot of things and uses the shared logic from videojs-generate-karma-config

Changes

  • Removes all browserify stuff outside of karma
  • Uses karma-static-server middleware instead of connect
  • Uses test/debug.html rather than test/index.html for debugging tests

config.frameworks.push('browserify');
config.plugins.push('karma-browserify');
config.browserify = {

This comment has been minimized.

@BrandonOCasey

BrandonOCasey Oct 25, 2018

Author Contributor

ideally this would all be in rollup, but the tests are heavily reliant on some things browserify does right now, so that will be a big job.

This comment has been minimized.

@gkatsev

gkatsev Oct 29, 2018

Member

Yeah, we really should move over to rollup at some point.

@gkatsev
Copy link
Member

gkatsev left a comment

coverage stuff should probably be done in a separate PR

Show resolved Hide resolved test/karma.conf.js
Show resolved Hide resolved test/karma.conf.js
Show resolved Hide resolved test/karma.conf.js
plugin: ['proxyquireify/plugin'],
transform: [
['babelify', {"presets": [["@babel/preset-env", {"loose": true}]]}],
'browserify-istanbul'

This comment has been minimized.

@gkatsev

gkatsev Oct 25, 2018

Member

is it possible to only include this it runs with coverage?

This comment has been minimized.

@BrandonOCasey

BrandonOCasey Oct 26, 2018

Author Contributor

In videojs-generate-karma-config we always generate coverage

This comment has been minimized.

@gkatsev

gkatsev Oct 26, 2018

Member

I would prefer if coverage was only generated when npm test --coverage was run and not if you just run npm test.

This comment has been minimized.

@BrandonOCasey

BrandonOCasey Oct 26, 2018

Author Contributor

Coverage generation with rollup only added about ~50ms, and we can just not report it. I think that it is nice to be able to view coverage at any given time, and its kind of the standard for plugins. If you really feel strongly about it though we can make it happen by removing the karma-coverage plugin and browserify-istanbul plugin and only adding them when using --coverage. Or we can just worry about this in a separate coverage pull request.

This comment has been minimized.

@gkatsev

gkatsev Oct 26, 2018

Member

The point isn't just the time spent. Coverage reporting instruments the code and can cause issues, so, it's always nice to be able to run without it.

Fixing it up in another PR is reasonable as long as we don't forget to do it.

This comment has been minimized.

@BrandonOCasey

BrandonOCasey Oct 26, 2018

Author Contributor

If we decide to turn of coverage I added an option. videojs/videojs-generate-karma-config#11

os: 'OS X',
os_version: 'El Capitan'
},
config.files = [

This comment has been minimized.

@gkatsev

gkatsev Oct 25, 2018

Member

can files be moved to the top of the configurations?

Show resolved Hide resolved test/karma.conf.js
Show resolved Hide resolved build/grunt.js
Show resolved Hide resolved build/grunt.js

BrandonOCasey added some commits Oct 26, 2018

cr

@BrandonOCasey BrandonOCasey force-pushed the chore/switch-to-geneate-karma branch from f9d1976 to 2525aaa Oct 26, 2018

@BrandonOCasey BrandonOCasey force-pushed the chore/switch-to-geneate-karma branch from 2525aaa to aed0462 Oct 29, 2018

@BrandonOCasey BrandonOCasey force-pushed the chore/switch-to-geneate-karma branch from 777e592 to 54d11ad Oct 29, 2018

@BrandonOCasey

This comment has been minimized.

Copy link
Contributor Author

BrandonOCasey commented Oct 29, 2018

coverage reporting in karma-coverage is throwing an error, I think we should opt to fix it in another pr, but coverage generation appears to be working.

@BrandonOCasey BrandonOCasey force-pushed the chore/switch-to-geneate-karma branch from bcb3ab5 to a5794e3 Oct 29, 2018

@gkatsev

This comment has been minimized.

Copy link
Member

gkatsev commented Oct 29, 2018

Switching to rollup for tests and enabling coverage definitely belong other PRs. Changes look good, I'd like to run this locally.

@gkatsev

This comment has been minimized.

Copy link
Member

gkatsev commented Oct 29, 2018

Safari and Safari Technology Preview won't open/run tests locally when I do npm test.

@gkatsev

This comment has been minimized.

Copy link
Member

gkatsev commented Oct 29, 2018

This may be broken in general for me and not just in this branch.

@gkatsev

This comment has been minimized.

Copy link
Member

gkatsev commented Oct 29, 2018

Safari and STP tests were failing for me because of karma-runner/karma-safari-launcher#29

@gkatsev

This comment has been minimized.

Copy link
Member

gkatsev commented Oct 29, 2018

So, with these changes there's no way to access tests without going through the karma server. The built test file is not really available anywhere I assume? Maybe it's just something I need to get used to. Also, we should potentially add a link to it from the sandbox/index.html file.

@BrandonOCasey

This comment has been minimized.

Copy link
Contributor Author

BrandonOCasey commented Oct 30, 2018

I was thinking that we should have an index.html in the root of the repo that points to sandbox and /test/debug.html which is similar to our previous page that does not run tests through karma

BrandonOCasey and others added some commits Oct 30, 2018

@gkatsev gkatsev merged commit 2e70450 into master Oct 31, 2018

4 checks passed

continuous-integration/codeship Build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
deploy/netlify Deploy preview ready!
Details

@gkatsev gkatsev deleted the chore/switch-to-geneate-karma branch Oct 31, 2018

@BrandonOCasey BrandonOCasey referenced this pull request Nov 28, 2018

Merged

Tests/fix travis #5627

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment