-
Notifications
You must be signed in to change notification settings - Fork 42
Cypress Build Unification #1002
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
base: master
Are you sure you want to change the base?
Conversation
const options = { | ||
hostname: '127.0.0.1', | ||
port, | ||
path: `/test-uuid?testIdentifier=${encodeURIComponent(testIdentifier)}`, | ||
method: 'GET', | ||
timeout: 2000 | ||
}; | ||
const req = http.request(options, (res) => { | ||
let data = ''; | ||
res.on('data', (chunk) => data += chunk); | ||
res.on('end', () => { | ||
if(res.statusCode === 200) { | ||
try { | ||
const json = JSON.parse(data || '{}'); | ||
return resolve({ testRunUuid: json.testRunUuid || null }); | ||
} catch(e) { | ||
return resolve(null); | ||
} | ||
} else if (res.statusCode === 404) { | ||
// Server up but endpoint not responding as expected – stop retrying. | ||
return resolve(null); | ||
} else { | ||
retryOrResolve(); | ||
} | ||
}); | ||
}); |
Check warning
Code scanning / Semgrep OSS
Semgrep Finding: problem-based-packs.insecure-transport.js-node.http-request.http-request Warning
method: 'GET', | ||
timeout: 2000 | ||
}; | ||
const req = http.request(options, (res) => { |
Check warning
Code scanning / Semgrep OSS
Semgrep Finding: problem-based-packs.insecure-transport.js-node.using-http-server.using-http-server Warning
bin/testhub/testhubHandler.js
Outdated
} | ||
} | ||
|
||
module.exports = TestHubHandler; No newline at end of file |
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.
EOF
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.
Added
bin/testhub/utils.js
Outdated
accessibility: accessibilityScanInfo[testData.name], | ||
}; | ||
} | ||
}; No newline at end of file |
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.
EOF
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.
Added
exports.isAccessibilityEnabled = () => { | ||
if (process.env.BROWSERSTACK_TEST_ACCESSIBILITY !== undefined) { | ||
return process.env.BROWSERSTACK_TEST_ACCESSIBILITY === "true"; | ||
} |
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.
Please add a log here for better clarity
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.
Added
this.platformDetailsMap = {}; | ||
this.runStatusMarkedHash = {}; | ||
this.haveSentBuildUpdate = false; | ||
this.startHttpServer(); |
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.
keep it in try catch if any how it fails to start and throw error
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.
Added try catch block inside the function
if(this.httpServer !== null) return; | ||
|
||
try { | ||
this.httpServer = http.createServer(async(req, res) => { |
Check warning
Code scanning / Semgrep OSS
Semgrep Finding: problem-based-packs.insecure-transport.js-node.using-http-server.using-http-server Warning test
Uh oh!
There was an error while loading. Please reload this page.