2020-03-13 08:09:22 -04:00
|
|
|
const mockProjectPath = 'root/autodevops-deploy';
|
|
|
|
|
2020-03-11 11:09:37 -04:00
|
|
|
export const mockEnvName = 'production';
|
|
|
|
export const mockEnvironmentsEndpoint = `${mockProjectPath}/environments.json`;
|
|
|
|
export const mockEnvId = '99';
|
|
|
|
export const mockDocumentationPath = '/documentation.md';
|
2020-03-13 08:09:22 -04:00
|
|
|
export const mockLogsEndpoint = '/dummy_logs_path.json';
|
|
|
|
export const mockCursor = 'MOCK_CURSOR';
|
|
|
|
export const mockNextCursor = 'MOCK_NEXT_CURSOR';
|
2020-03-11 11:09:37 -04:00
|
|
|
|
|
|
|
const makeMockEnvironment = (id, name, advancedQuerying) => ({
|
|
|
|
id,
|
|
|
|
project_path: mockProjectPath,
|
|
|
|
name,
|
2020-03-13 08:09:22 -04:00
|
|
|
logs_api_path: mockLogsEndpoint,
|
2020-03-11 11:09:37 -04:00
|
|
|
enable_advanced_logs_querying: advancedQuerying,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const mockEnvironment = makeMockEnvironment(mockEnvId, mockEnvName, true);
|
|
|
|
export const mockEnvironments = [
|
|
|
|
mockEnvironment,
|
|
|
|
makeMockEnvironment(101, 'staging', false),
|
|
|
|
makeMockEnvironment(102, 'review/a-feature', false),
|
|
|
|
];
|
|
|
|
|
|
|
|
export const mockPodName = 'production-764c58d697-aaaaa';
|
|
|
|
export const mockPods = [
|
|
|
|
mockPodName,
|
|
|
|
'production-764c58d697-bbbbb',
|
|
|
|
'production-764c58d697-ccccc',
|
|
|
|
'production-764c58d697-ddddd',
|
|
|
|
];
|
|
|
|
|
|
|
|
export const mockLogsResult = [
|
2020-03-17 23:09:43 -04:00
|
|
|
{
|
|
|
|
timestamp: '2019-12-13T13:43:18.2760123Z',
|
2020-04-16 05:09:37 -04:00
|
|
|
message: 'log line 1',
|
2020-03-17 23:09:43 -04:00
|
|
|
pod: 'foo',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
timestamp: '2019-12-13T13:43:18.2760123Z',
|
2020-04-16 05:09:37 -04:00
|
|
|
message: 'log line A',
|
2020-03-17 23:09:43 -04:00
|
|
|
pod: 'bar',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
timestamp: '2019-12-13T13:43:26.8420123Z',
|
2020-04-16 05:09:37 -04:00
|
|
|
message: 'log line 2',
|
2020-03-17 23:09:43 -04:00
|
|
|
pod: 'foo',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
timestamp: '2019-12-13T13:43:26.8420123Z',
|
2020-04-16 05:09:37 -04:00
|
|
|
message: 'log line B',
|
2020-03-17 23:09:43 -04:00
|
|
|
pod: 'bar',
|
|
|
|
},
|
2020-03-11 11:09:37 -04:00
|
|
|
];
|
|
|
|
|
|
|
|
export const mockTrace = [
|
2020-04-16 05:09:37 -04:00
|
|
|
'Dec 13 13:43:18.276 | foo | log line 1',
|
|
|
|
'Dec 13 13:43:18.276 | bar | log line A',
|
|
|
|
'Dec 13 13:43:26.842 | foo | log line 2',
|
|
|
|
'Dec 13 13:43:26.842 | bar | log line B',
|
2020-03-11 11:09:37 -04:00
|
|
|
];
|
|
|
|
|
2020-03-13 08:09:22 -04:00
|
|
|
export const mockResponse = {
|
|
|
|
pod_name: mockPodName,
|
|
|
|
pods: mockPods,
|
|
|
|
logs: mockLogsResult,
|
|
|
|
cursor: mockNextCursor,
|
|
|
|
};
|
|
|
|
|
2020-03-11 11:09:37 -04:00
|
|
|
export const mockSearch = 'foo +bar';
|