Skip to content

Commit

Permalink
sync with master
Browse files Browse the repository at this point in the history
  • Loading branch information
Fawke committed Dec 13, 2019
2 parents 723c298 + b615862 commit 043626d
Show file tree
Hide file tree
Showing 440 changed files with 8,392 additions and 44,418 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ When you are adding code to Prebid.js, or modifying code that isn't covered by a
- _Assert_: check that the expected results have occurred
- e.g., use Chai assertions to check that the expected output is equal to the actual output
- Test the public interface, not the internal implementation
- If you need to check `adloader.loadScript` in a test, use a `stub` rather than a `spy`. `spy`s trigger a network call which can result in a `script error` and cause unrelated unit tests to fail. `stub`s will let you gather information about the `adloader.loadScript` call without affecting external resources
- If you need to check `adloader.loadExternalScript` in a test, use a `stub` rather than a `spy`. `spy`s trigger a network call which can result in a `script error` and cause unrelated unit tests to fail. `stub`s will let you gather information about the `adloader.loadExternalScript` call without affecting external resources
- When writing tests you may use ES2015 syntax if desired

### Test Examples
Expand Down
25 changes: 24 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ var prebid = require('./package.json');
var dateString = 'Updated : ' + (new Date()).toISOString().substring(0, 10);
var banner = '/* <%= prebid.name %> v<%= prebid.version %>\n' + dateString + ' */\n';
var port = 9999;
const mockServerPort = 4444;
const host = argv.host ? argv.host : 'localhost';
const { spawn } = require('child_process');

// these modules must be explicitly listed in --modules to be included in the build, won't be part of "all" modules
var explicitModules = [
Expand Down Expand Up @@ -234,12 +237,26 @@ function test(done) {
wdioConf
];
}

//run mock-server
const mockServer = spawn('node', ['./test/mock-server/index.js', '--port='+mockServerPort]);
mockServer.stdout.on('data', (data) => {
console.log(`stdout: ${data}`);
});
mockServer.stderr.on('data', (data) => {
console.log(`stderr: ${data}`);
});

execa(wdioCmd, wdioOpts, { stdio: 'inherit' })
.then(stdout => {
//kill mock server
mockServer.kill('SIGINT');
done();
process.exit(0);
})
.catch(err => {
//kill mock server
mockServer.kill('SIGINT');
done(new Error(`Tests failed with error: ${err}`));
process.exit(1);
});
Expand Down Expand Up @@ -309,6 +326,12 @@ function setupE2e(done) {
done();
}

gulp.task('updatepath', function(){
return gulp.src(['build/dist/*.js'])
.pipe(replace('ib.adnxs.com/ut/v3/prebid', host + ':' + mockServerPort + '/'))
.pipe(gulp.dest('build/dist'));
});

// support tasks
gulp.task(lint);
gulp.task(watch);
Expand All @@ -334,7 +357,7 @@ gulp.task('build-postbid', gulp.series(escapePostbidConfig, buildPostbid));
gulp.task('serve', gulp.series(clean, lint, gulp.parallel('build-bundle-dev', watch, test)));
gulp.task('default', gulp.series(clean, makeWebpackPkg));

gulp.task('e2e-test', gulp.series(clean, setupE2e, gulp.parallel('build-bundle-prod', watch), test))
gulp.task('e2e-test', gulp.series(clean, setupE2e, gulp.parallel('build-bundle-prod', watch), 'updatepath', test));
// other tasks
gulp.task(bundleToStdout);
gulp.task('bundle', gulpBundle.bind(null, false)); // used for just concatenating pre-built files with no build step
Expand Down
6 changes: 5 additions & 1 deletion integrationExamples/gpt/prebidServer_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@
pbjs.que.push(function() {
var adUnits = [{
code: 'div-gpt-ad-1460505748561-0',
sizes: [[300, 250]],
mediaTypes: {
banner: {
sizes: [[300, 250]]
}
},
bids: [
{
bidder: 'appnexus',
Expand Down
3 changes: 3 additions & 0 deletions modules/.submodules.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{
"userId": [
"unifiedIdSystem",
"pubCommonIdSystem",
"digiTrustIdSystem",
"id5IdSystem",
"criteortusIdSystem",
"parrableIdSystem",
"britepoolIdSystem",
"liveIntentIdSystem",
"criteoIdSystem"
],
Expand Down
155 changes: 0 additions & 155 deletions modules/7xbidBidAdapter.js

This file was deleted.

89 changes: 0 additions & 89 deletions modules/a4gBidAdapter.js

This file was deleted.

4 changes: 2 additions & 2 deletions modules/aardvarkBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const spec = {
var req = requestsMap[auctionId];
requests.push({
method: 'GET',
url: `//${req.endpoint}/${auctionId}/${req.shortCodes.join('_')}/aardvark`,
url: `https://${req.endpoint}/${auctionId}/${req.shortCodes.join('_')}/aardvark`,
data: req.payload,
bidderRequest
});
Expand Down Expand Up @@ -162,7 +162,7 @@ export const spec = {

getUserSyncs: function(syncOptions, serverResponses, gdprConsent) {
const syncs = [];
var url = '//' + SYNC_ENDPOINT + '/cs';
var url = 'https://' + SYNC_ENDPOINT + '/cs';
var gdprApplies = false;
if (gdprConsent && (typeof gdprConsent.gdprApplies === 'boolean')) {
gdprApplies = gdprConsent.gdprApplies;
Expand Down
Loading

0 comments on commit 043626d

Please sign in to comment.