-
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
E2e mock server #4456
Conversation
…into e2e-mock-server
You just said the magic words: "testing environment more stable". I'm behind this now. |
Yeah sounds good!
Will review today
|
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 tried e2e test command but it didn't work. I tried running the banner test with changes made to wdio.conf file.
gulpfile.js
Outdated
@@ -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'; |
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 ?
gulpfile.js
Outdated
@@ -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 comment
The 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
} | ||
res.type('json'); | ||
if (req.method === 'GET') { | ||
response = 'apntag.handleCb(' + JSON.stringify(response) + ');'; |
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 is not needed for Prebid
This pull request introduces 1 alert when merging 4e6c2cb into 373f593 - view on LGTM.com new alerts:
|
I too am having issues running it locally. I think we should add instructions on how to run it locally and all the things which are required. |
Hi @robertrmartinez , after switching to the branch you need to do:
And it should run the banner test on all browsers. You can test the response from Please ignore any errors while |
# Conflicts: # package-lock.json
Type of change
Description of change
Our circle CI builds are failing frequently, and one of the obvious reasons for this, is inconsistency in the response from the bid server(s) that we have used for our e2e-tests. In most tests, we have used appnexus server which mostly is not returning any response in the expected time resulting in timeout errors that we see in our daily workflow, here is one example.
Hence we came up with this solution of using a mock server which would return response from a static file based on the request it receives. For this, we would add request and response pair files (one is added in this PR), and the mock-server with the help of its middleware (prebid-request.js) will search for the matching request and send the corresponding response. This would not only make our testing environment more stable but would also make the tests run faster.