-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
E2e mock server #4456
Merged
Merged
E2e mock server #4456
Changes from 6 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
c0d4395
e2e test mock server and midlleware
f28e9a4
mock server request response
12ced42
remove unwanted logs and packages
087192c
Merge branch 'master' into e2e-mock-server
sumit116 df1c4aa
fix jshint errors
8371845
Merge branch 'e2e-mock-server' of https://github.com/prebid/Prebid.js…
1929150
update folder to /dist
f3847ef
temporary changes to run only banner test
4e6c2cb
remove trailing space
8090c78
refactor
d0e70f4
Merge branch 'master' of https://github.com/prebid/Prebid.js into e2e…
2009f31
make mock server a child process of test task
95cd770
Merge branch 'e2e-mock-server' into e2e-mock-native
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 prebidLocation = './src/prebid.js'; | ||
const mockServerPort = 3000; | ||
const host = argv.host ? argv.host : 'localhost'; | ||
|
||
// these modules must be explicitly listed in --modules to be included in the build, won't be part of "all" modules | ||
var explicitModules = [ | ||
|
@@ -309,6 +312,12 @@ function setupE2e(done) { | |
done(); | ||
} | ||
|
||
gulp.task('updatepath', function(){ | ||
return gulp.src(['build/dev/*.js']) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. test pages defined in e2e are using dist path. On running e2e-test, it will still hit the ut/v3 endpoint |
||
.pipe(replace('ib.adnxs.com/ut/v3/prebid', host + ':' + mockServerPort + '/')) | ||
.pipe(gulp.dest('build/dev')); | ||
}); | ||
|
||
// support tasks | ||
gulp.task(lint); | ||
gulp.task(watch); | ||
|
@@ -331,10 +340,17 @@ gulp.task('coveralls', gulp.series('test-coverage', coveralls)); | |
gulp.task('build', gulp.series(clean, 'build-bundle-prod')); | ||
gulp.task('build-postbid', gulp.series(escapePostbidConfig, buildPostbid)); | ||
|
||
gulp.task('mockserver', function() { | ||
return gulp.src(prebidLocation) | ||
.pipe(shell('node ./test/mock-server/index.js --port='+mockServerPort, function (err, stdout, stderr) { | ||
console.log(stdout); | ||
console.log(stderr); | ||
})) | ||
}); | ||
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, 'build-bundle-dev', 'updatepath', gulp.parallel('mockserver', watch, test))); | ||
// other tasks | ||
gulp.task(bundleToStdout); | ||
gulp.task('bundle', gulpBundle.bind(null, false)); // used for just concatenating pre-built files with no build step | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 the use for this const ?