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

add option to run tests in a specific file #1727

Merged
merged 4 commits into from Oct 24, 2017
Merged

add option to run tests in a specific file #1727

merged 4 commits into from Oct 24, 2017

Conversation

thewizarodofoz
Copy link
Contributor

Type of change

  • CI related changes

Description of change

When developing an adapter, I don't need to run the whole test suite, it's very time consuming. This PR adds an option to run a specific test file. Usage:

$ gulp test --file "test/spec/modules/vidazooBidAdapter_spec.js"

var webpackConfig = newWebpackConfig(codeCoverage);
var plugins = newPluginsArray(browserstack);
var files = [
var files = file ? [file] : [
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this needs to be var files = file ? ['test/helpers/prebidGlobal.js', file] : ...

Otherwise it fails on files which use $$PREBID_GLOBAL$$--even if it's just indirectly, through the import chain. For example, gulp test --file "test/spec/modules/appnexusAstBidAdapter_spec.js" fails because the adapter relies on src/config, which relies on $$PREBID_GLOBAL$$.

This problem should fade away as progress gets made on #1508 and #1510... but for now it's common enough that the gulpfile should probably support it.

// If --browserstack is given, it will run the full suite of currently supported browsers.
// If --browsers is given, browsers can be chosen explicitly. e.g. --browsers=chrome,firefox,ie9
gulp.task('test', ['clean'], function (done) {
var karmaConf = karmaConfMaker(false, argv.browserstack, argv.watch);
var karmaConf = karmaConfMaker(false, argv.browserstack, argv.watch, argv.file);
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you also add this to the test-coverage task?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure

@thewizarodofoz
Copy link
Contributor Author

@dbemiller thanks for the review! I have committed the changes.

@dbemiller dbemiller added the LGTM label Oct 24, 2017
@dbemiller dbemiller merged commit 19deb8e into prebid:master Oct 24, 2017
@dbemiller dbemiller mentioned this pull request Oct 24, 2017
Millerrok pushed a commit to Vertamedia/Prebid.js that referenced this pull request Oct 25, 2017
* 'master' of https://github.com/prebid/Prebid.js: (414 commits)
  Make response headers available to the specs (prebid#1748)
  add option to run tests in a specific file (prebid#1727)
  Update JCM Adapter to 1.0  (prebid#1715)
  Finished an unfinished comment. (prebid#1749)
  Platform.io Bidder Adapter update.  Prebid v1.0. (prebid#1705)
  Fix window.top.host cross origin issue when in nested iframes. (prebid#1730)
  fix log message not displaying when referencing missing bidder (prebid#1737)
  Allow more than one placement from one page (prebid#1692)
  Justpremium Adapter bugfix (prebid#1716)
  Updating license (prebid#1717)
  realvuBidAdapter  (prebid#1571)
  Update JSDoc to call the module `pbjs` (prebid#1572)
  Update Beachfront adapter for v1.0 (prebid#1675)
  Update AdButler adapter for Prebid v1.0 (prebid#1664)
  Increment pre version
  Fix for prebid#1628 (allowing standard bidCpmAdjustment) (prebid#1645)
  Prebid 0.31.0 Release
  Support native click tracking (prebid#1691)
  Initial commit for video support for pbs (prebid#1706)
  Fixes: Immediate adapter response may end auction (prebid#1690)
  ...
mattpr pushed a commit to mattpr/Prebid.js that referenced this pull request Oct 31, 2017
* add option to run tests in a specific file

* add option to run tests in a specific file

* Update gulpfile.js

* Update karma.conf.maker.js
dluxemburg pushed a commit to Genius/Prebid.js that referenced this pull request Jul 17, 2018
* add option to run tests in a specific file

* add option to run tests in a specific file

* Update gulpfile.js

* Update karma.conf.maker.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants