Skip to content

Commit

Permalink
Feat/grafanatestrunid (#410)
Browse files Browse the repository at this point in the history
  • Loading branch information
enudler authored Sep 25, 2020
1 parent edc0ea9 commit 46ad958
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/reports/models/reportsManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ function getReportResponse(summaryRow, config) {
function generateGrafanaUrl(report, grafanaUrl) {
if (grafanaUrl) {
const endTimeGrafanafaQuery = report.end_time ? `&to=${new Date(report.end_time).getTime()}` : '&to=now';
const grafanaReportUrl = encodeURI(grafanaUrl + `&var-Name=${report.test_name}&from=${new Date(report.start_time).getTime()}${endTimeGrafanafaQuery}`);
const grafanaReportUrl = encodeURI(grafanaUrl + `&var-Name=${report.test_name}&var-TestRunId=${report.report_id}&from=${new Date(report.start_time).getTime()}${endTimeGrafanafaQuery}`);
return grafanaReportUrl;
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/unit-tests/reporter/models/reportsManager-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ describe('Reports manager tests', function () {
const report = await manager.getReport();
should.exist(report);
should.exist(report.grafana_report);
should(report.grafana_report).eql('http://www.grafana.com&var-Name=test%20name&from=1527533459591&to=now');
should(report.grafana_report).eql('http://www.grafana.com&var-Name=test%20name&var-TestRunId=report_id&from=1527533459591&to=now');
});

it('Database connector returns an array with one report and score ', async () => {
Expand Down

0 comments on commit 46ad958

Please sign in to comment.