-
Notifications
You must be signed in to change notification settings - Fork 39
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
feat(merge-reports): ability to pass headers for databaseUrls.json files #527
Conversation
const [key, ...values] = header.split('='); | ||
return _.set(acc, key, values.join('=')); | ||
}, {}); | ||
const parsedHeaders = {...headersFromCli, ...headersFromEnv}; |
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.
Хедеры из переменной окружения имеют больший приоритет.
try { | ||
headersFromEnv = JSON.parse(process.env.html_reporter_headers || '{}'); | ||
} catch (e) { | ||
throw new Error(`Couldn't parse headers from "html_reporter_headers" env variable: ${e.message}`); |
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.
Нужно докидывать понятное сообщение о ошибке иначе будет отображаться стандартная ошибка из json.parse
(нефига не понятная)
@@ -63,7 +63,7 @@ | |||
"dependencies": { | |||
"@babel/runtime": "^7.22.5", | |||
"@gemini-testing/sql.js": "^2.0.0", | |||
"axios": "^0.18.1", | |||
"axios": "^1.6.5", |
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.
Заодно апнул версию axios (по идее проблем быть не должно)
54ba855
to
0ba9568
Compare
lib/merge-reports/index.js
Outdated
const jsonUrls = []; | ||
const dbUrls = []; | ||
|
||
if (serverUtils.isDbUrl(url)) { | ||
dbUrls.push(url); | ||
} else if (serverUtils.isJsonUrl(url)) { | ||
try { | ||
const {data} = await axios.get(url); | ||
console.log('headers:', headers); |
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.
забыл?
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.
да, поправил
0ba9568
to
2c7a19b
Compare
2c7a19b
to
a367122
Compare
Add the ability to send headers for download databaseUrls.json files