Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/dev/mockoon.json
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@
},
{
"uuid": "0422d383-e901-4d38-966b-f3b4653bb5c9",
"body": "{\n \"status\": \"Non-Compliant\",\n \"device\": {{data 'cntg' '0'}},\n \"started\": \"2023-06-22T09:20:00.123Z\",\n \"finished\": \"2023-06-22T09:26:00.123Z\",\n \"report\": \"report/f0d4e2f2f541_2026-02-02T17:24:52\",\n \"export\": \"export/f0d4e2f2f541_2026-02-02T17:24:52\",\n \"tests\": {\n \"total\": 26,\n \"results\": [\n {\n \"name\": \"dns.network.hostname_resolution\",\n \"description\": \"The device should resolve hostnames\",\n \"result\": \"Non-Compliant\",\n \"required_result\": \"Compliant\"\n \"recommendations\": [\n \"An example of a step to resolve\",\n \"Disable any running NTP server\"\n ]\n },\n {\n \"name\": \"dns.network.from_dhcp\",\n \"description\": \"The device should use the DNS server provided by the DHCP server\",\n \"result\": \"Compliant\",\n \"required_result\": \"Roadmap\"\n },\n {\n \"name\": \"security.services.ftp\",\n \"description\": \"FTP server should not be available\",\n \"result\": \"Compliant\",\n \"required_result\": \"Required\"\n }\n ]\n }\n}",
"body": "{\n \"status\": \"Non-Compliant\",\n \"device\": {{data 'cntg' '0'}},\n \"started\": \"2023-06-22T09:20:00.123Z\",\n \"finished\": \"2023-06-22T09:26:00.123Z\",\n \"report\": \"/report/f0d4e2f2f541_2026-02-02T17:24:52\",\n \"export\": \"/export/f0d4e2f2f541_2026-02-02T17:24:52\",\n \"tests\": {\n \"total\": 26,\n \"results\": [\n {\n \"name\": \"dns.network.hostname_resolution\",\n \"description\": \"The device should resolve hostnames\",\n \"result\": \"Non-Compliant\",\n \"required_result\": \"Compliant\"\n \"recommendations\": [\n \"An example of a step to resolve\",\n \"Disable any running NTP server\"\n ]\n },\n {\n \"name\": \"dns.network.from_dhcp\",\n \"description\": \"The device should use the DNS server provided by the DHCP server\",\n \"result\": \"Compliant\",\n \"required_result\": \"Roadmap\"\n },\n {\n \"name\": \"security.services.ftp\",\n \"description\": \"FTP server should not be available\",\n \"result\": \"Compliant\",\n \"required_result\": \"Required\"\n }\n ]\n }\n}",
"latency": 0,
"statusCode": 200,
"label": "Test Run Non-Compliant",
Expand All @@ -509,7 +509,7 @@
},
{
"uuid": "46e4d42e-823b-440f-9c59-d344c0f51019",
"body": "{\n \"status\": \"Compliant\",\n \"device\": {{data 'cntg' '0'}},\n \"started\": \"2023-06-22T09:20:00.123Z\",\n \"finished\": \"2023-06-22T09:26:00.123Z\",\n \"report\": \"report/f0d4e2f2f541_2026-02-02T17:24:52\",\n \"export\": \"export/f0d4e2f2f541_2026-02-02T17:24:52\",\n \"tests\": {\n \"total\": 3,\n \"results\": [\n {\n \"name\": \"dns.network.hostname_resolution\",\n \"description\": \"The device should resolve hostnames\",\n \"result\": \"Compliant\",\n \"required_result\": \"Required\"\n },\n {\n \"name\": \"dns.network.from_dhcp\",\n \"description\": \"The device should use the DNS server provided by the DHCP server\",\n \"result\": \"Feature Not Present\",\n \"required_result\": \"Roadmap\"\n },\n {\n \"name\": \"security.services.ftp\",\n \"description\": \"FTP server should not be available\",\n \"result\": \"Compliant\",\n \"required_result\": \"Required\"\n }\n ]\n }\n}",
"body": "{\n \"status\": \"Compliant\",\n \"device\": {{data 'cntg' '0'}},\n \"started\": \"2023-06-22T09:20:00.123Z\",\n \"finished\": \"2023-06-22T09:26:00.123Z\",\n \"report\": \"/report/f0d4e2f2f541_2026-02-02T17:24:52\",\n \"export\": \"/export/f0d4e2f2f541_2026-02-02T17:24:52\",\n \"tests\": {\n \"total\": 3,\n \"results\": [\n {\n \"name\": \"dns.network.hostname_resolution\",\n \"description\": \"The device should resolve hostnames\",\n \"result\": \"Compliant\",\n \"required_result\": \"Required\"\n },\n {\n \"name\": \"dns.network.from_dhcp\",\n \"description\": \"The device should use the DNS server provided by the DHCP server\",\n \"result\": \"Feature Not Present\",\n \"required_result\": \"Roadmap\"\n },\n {\n \"name\": \"security.services.ftp\",\n \"description\": \"FTP server should not be available\",\n \"result\": \"Compliant\",\n \"required_result\": \"Required\"\n }\n ]\n }\n}",
"latency": 0,
"statusCode": 200,
"label": "Testrun Compliant",
Expand Down Expand Up @@ -605,7 +605,7 @@
"responses": [
{
"uuid": "3cd002ad-a8fa-4a35-860b-b2902a8c6c4e",
"body": "[\n {\n \"testrun\": {\n \"version\": \"2.2.2\"\n },\n \"device\": {{data 'cntg' '0'}},\n \"status\": \"Non-Compliant\",\n \"started\": \"2026-02-02 17:24:52\",\n \"finished\": \"2026-02-02 17:34:58\",\n \"report\": \"report/f0d4e2f2f541_2026-02-02T17:24:52\",\n \"export\": \"export/f0d4e2f2f541_2026-02-02T17:24:52\",\n \"folder_name\": \"f0d4e2f2f541_2026-02-02T17:24:52\",\n \"delete\": \"report/f0d4e2f2f541_2026-02-02T17:24:52\"\n }\n]",
"body": "[\n {\n \"testrun\": {\n \"version\": \"2.2.2\"\n },\n \"device\": {{data 'cntg' '0'}},\n \"status\": \"Non-Compliant\",\n \"started\": \"2026-02-02 17:24:52\",\n \"finished\": \"2026-02-02 17:34:58\",\n \"report\": \"/report/f0d4e2f2f541_2026-02-02T17:24:52\",\n \"export\": \"/export/f0d4e2f2f541_2026-02-02T17:24:52\",\n \"folder_name\": \"f0d4e2f2f541_2026-02-02T17:24:52\",\n \"delete\": \"/report/f0d4e2f2f541_2026-02-02T17:24:52\"\n }\n]",
"latency": 0,
"statusCode": 200,
"label": "",
Expand Down
2 changes: 1 addition & 1 deletion make/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: Testrun
Version: 2.3.3
Version: 2.3.4-beta.1
Architecture: amd64
Maintainer: Google <ssm-orcas@google.com>
Homepage: https://github.com/google/testrun
Expand Down
2 changes: 1 addition & 1 deletion modules/ui/src/app/app.store.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ describe('AppStore', () => {
},
started: '2023-06-22T09:20:00.123Z',
finished: '2023-06-22T09:26:00.123Z',
report: 'report/123',
report: '/report/123',
export: 'https://api.testrun.io/export.pdf',
tags: [],
tests: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ describe('DownloadReportComponent', () => {
) as HTMLAnchorElement;

expect(downloadReportLink).not.toBeNull();
expect(downloadReportLink.href).toContain('report/123');
expect(downloadReportLink.href).toContain('/report/123');
expect(downloadReportLink.download).toEqual(
'delta_03-din-cpu_1.2.2_compliant_22_jun_2023_9:20'
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ describe('DownloadReportComponent', () => {
) as HTMLAnchorElement;

expect(downloadReportLink).not.toBeNull();
expect(downloadReportLink.href).toContain('report/123');
expect(downloadReportLink.href).toContain('/report/123');
expect(downloadReportLink.download).toEqual(
'delta_03-din-cpu_1.2.2_compliant_22_jun_2023_9:20'
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('TestingCompleteComponent', () => {
profiles: [],
testrunStatus: MOCK_PROGRESS_DATA_COMPLIANT,
isTestingComplete: true,
report: 'report/123',
report: '/report/123',
export: '',
isPilot: false,
},
Expand Down
48 changes: 24 additions & 24 deletions modules/ui/src/app/mocks/reports.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ export const HISTORY = [
firmware: '1.2.2',
test_pack: TestingType.Qualification,
},
report: 'report/123',
export: 'export/123',
delete: 'report/123',
report: '/report/123',
export: '/export/123',
delete: '/report/123',
started: '2023-06-23T10:11:00.123Z',
finished: '2023-06-23T10:17:10.123Z',
},
Expand All @@ -31,9 +31,9 @@ export const HISTORY = [
firmware: '1.2.3',
test_pack: TestingType.Qualification,
},
report: 'report/1234',
export: 'export/1234',
delete: 'report/1234',
report: '/report/1234',
export: '/export/1234',
delete: '/report/1234',
started: '2023-07-23T10:11:00.123Z',
finished: '2023-07-23T10:17:10.123Z',
},
Expand All @@ -48,9 +48,9 @@ export const HISTORY = [
firmware: '1.2.2',
test_pack: TestingType.Qualification,
},
report: 'report/12345',
export: 'export/12345',
delete: 'report/12345',
report: '/report/12345',
export: '/export/12345',
delete: '/report/12345',
started: '2023-06-23T10:11:00.123Z',
finished: '2023-06-23T10:17:10.123Z',
},
Expand All @@ -68,9 +68,9 @@ export const HISTORY_AFTER_REMOVE = [
firmware: '1.2.2',
test_pack: TestingType.Qualification,
},
report: 'report/123',
export: 'export/123',
delete: 'report/123',
report: '/report/123',
export: '/export/123',
delete: '/report/123',
started: '2023-06-23T10:11:00.123Z',
finished: '2023-06-23T10:17:10.123Z',
},
Expand All @@ -85,9 +85,9 @@ export const HISTORY_AFTER_REMOVE = [
firmware: '1.2.2',
test_pack: TestingType.Qualification,
},
report: 'report/12345',
export: 'export/12345',
delete: 'report/12345',
report: '/report/12345',
export: '/export/12345',
delete: '/report/12345',
started: '2023-06-23T10:11:00.123Z',
finished: '2023-06-23T10:17:10.123Z',
},
Expand All @@ -105,9 +105,9 @@ export const FORMATTED_HISTORY = [
firmware: '1.2.2',
test_pack: TestingType.Qualification,
},
report: 'report/123',
export: 'export/123',
delete: 'report/123',
report: '/report/123',
export: '/export/123',
delete: '/report/123',
started: '2023-06-23T10:11:00.123Z',
finished: '2023-06-23T10:17:10.123Z',
deviceFirmware: '1.2.2',
Expand All @@ -127,9 +127,9 @@ export const FORMATTED_HISTORY = [
firmware: '1.2.3',
test_pack: TestingType.Qualification,
},
report: 'report/1234',
export: 'export/1234',
delete: 'report/1234',
report: '/report/1234',
export: '/export/1234',
delete: '/report/1234',
started: '2023-07-23T10:11:00.123Z',
finished: '2023-07-23T10:17:10.123Z',
deviceFirmware: '1.2.3',
Expand All @@ -149,9 +149,9 @@ export const FORMATTED_HISTORY = [
firmware: '1.2.2',
test_pack: TestingType.Qualification,
},
report: 'report/12345',
export: 'export/12345',
delete: 'report/12345',
report: '/report/12345',
export: '/export/12345',
delete: '/report/12345',
started: '2023-06-23T10:11:00.123Z',
finished: '2023-06-23T10:17:10.123Z',
deviceFirmware: '1.2.2',
Expand Down
6 changes: 3 additions & 3 deletions modules/ui/src/app/mocks/testrun.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export const MOCK_PROGRESS_DATA_COMPLIANT: TestrunStatus =
StatusOfTestrun.Complete,
'2023-06-22T09:20:00.123Z',
TEST_DATA,
'report/123',
'/report/123',
ResultOfTestrun.Compliant
);

Expand All @@ -140,15 +140,15 @@ export const MOCK_PROGRESS_DATA_NON_COMPLIANT: TestrunStatus =
StatusOfTestrun.Complete,
'2023-06-22T09:20:00.123Z',
TEST_DATA_RESULT,
'report/123',
'/report/123',
ResultOfTestrun.NonCompliant
);

export const MOCK_PROGRESS_DATA_PROCEED: TestrunStatus = PROGRESS_DATA_RESPONSE(
StatusOfTestrun.Proceed,
'2023-06-22T09:20:00.123Z',
TEST_DATA_RESULT,
'report/123',
'/report/123',
ResultOfTestrun.Compliant
);

Expand Down
2 changes: 1 addition & 1 deletion modules/ui/src/app/pages/reports/reports.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ describe('ReportsComponent', () => {
it('#removeDevice should call delete report', () => {
const data = HISTORY[0];
component.removeReport(data);
expect(mockReportsStore.deleteReport).toHaveBeenCalledWith('report/123');
expect(mockReportsStore.deleteReport).toHaveBeenCalledWith('/report/123');
});
});

Expand Down
4 changes: 2 additions & 2 deletions modules/ui/src/app/pages/reports/reports.store.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ describe('ReportsStore', () => {
store.overrideSelector(selectReports, [...HISTORY]);
store.refreshState();

reportsStore.deleteReport('report/1234');
reportsStore.deleteReport('/report/1234');

expect(store.dispatch).toHaveBeenCalledWith(
setReports({ reports: HISTORY_AFTER_REMOVE })
Expand All @@ -194,7 +194,7 @@ describe('ReportsStore', () => {
store.overrideSelector(selectReports, [...HISTORY_AFTER_REMOVE]);
store.refreshState();

reportsStore.deleteReport('report/12345');
reportsStore.deleteReport('/report/12345');

expect(store.dispatch).toHaveBeenCalledWith(
setReports({ reports: [HISTORY_AFTER_REMOVE[0]] })
Expand Down
6 changes: 3 additions & 3 deletions modules/ui/src/app/services/test-run.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ describe('TestRunService', () => {
{
status: 'Complete',
device: device,
report: 'report/123',
report: '/report/123',
started: '2023-06-22T10:11:00.123Z',
finished: '2023-06-22T10:17:00.123Z',
},
Expand Down Expand Up @@ -462,7 +462,7 @@ describe('TestRunService', () => {
it('deleteReport should have necessary request data', () => {
const apiUrl = 'http://localhost:8000/report';

service.deleteReport('report').subscribe(res => {
service.deleteReport('http://localhost:8000/report').subscribe(res => {
expect(res).toEqual(true);
});

Expand All @@ -474,7 +474,7 @@ describe('TestRunService', () => {
it('deleteReport should return false when error happens', () => {
const apiUrl = 'http://localhost:8000/report';

service.deleteReport('report').subscribe(res => {
service.deleteReport('http://localhost:8000/report').subscribe(res => {
expect(res).toEqual(false);
});

Expand Down
4 changes: 2 additions & 2 deletions modules/ui/src/app/services/test-run.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,11 @@ export class TestRunService {
}

getReportLink(url: string): string {
return `${API_URL}/${url}`;
return `${url}`;
}

deleteReport(url: string): Observable<boolean> {
return this.http.delete<boolean>(`${API_URL}/${url}`).pipe(
return this.http.delete<boolean>(`${url}`).pipe(
catchError(() => of(false)),
map(res => !!res)
);
Expand Down
Loading