2020-04-08 14:13:33 +05:30
|
|
|
const mockProjectPath = 'root/autodevops-deploy';
|
|
|
|
|
|
|
|
export const mockEnvName = 'production';
|
|
|
|
export const mockEnvironmentsEndpoint = `${mockProjectPath}/environments.json`;
|
|
|
|
export const mockEnvId = '99';
|
|
|
|
export const mockDocumentationPath = '/documentation.md';
|
|
|
|
export const mockLogsEndpoint = '/dummy_logs_path.json';
|
|
|
|
export const mockCursor = 'MOCK_CURSOR';
|
|
|
|
export const mockNextCursor = 'MOCK_NEXT_CURSOR';
|
2020-07-28 23:09:34 +05:30
|
|
|
export const mockManagedAppName = 'kubernetes-cluster-1';
|
|
|
|
export const mockManagedAppsEndpoint = `${mockProjectPath}/clusters.json`;
|
2020-04-08 14:13:33 +05:30
|
|
|
|
|
|
|
const makeMockEnvironment = (id, name, advancedQuerying) => ({
|
|
|
|
id,
|
|
|
|
project_path: mockProjectPath,
|
|
|
|
name,
|
|
|
|
logs_api_path: mockLogsEndpoint,
|
|
|
|
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),
|
|
|
|
];
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
export const mockManagedApps = [
|
|
|
|
{
|
|
|
|
cluster_type: 'project_type',
|
|
|
|
enabled: true,
|
|
|
|
environment_scope: '*',
|
|
|
|
name: 'kubernetes-cluster-1',
|
|
|
|
provider_type: 'user',
|
|
|
|
status: 'connected',
|
|
|
|
path: '/root/autodevops-deploy/-/clusters/15',
|
|
|
|
gitlab_managed_apps_logs_path: '/root/autodevops-deploy/-/logs?cluster_id=15',
|
2020-11-24 15:15:51 +05:30
|
|
|
enable_advanced_logs_querying: true,
|
2020-07-28 23:09:34 +05:30
|
|
|
},
|
2020-10-24 23:57:45 +05:30
|
|
|
{
|
|
|
|
cluster_type: 'project_type',
|
|
|
|
enabled: true,
|
|
|
|
environment_scope: '*',
|
|
|
|
name: 'kubernetes-cluster-2',
|
|
|
|
provider_type: 'user',
|
|
|
|
status: 'connected',
|
|
|
|
path: '/root/autodevops-deploy/-/clusters/16',
|
|
|
|
gitlab_managed_apps_logs_path: null,
|
2020-11-24 15:15:51 +05:30
|
|
|
enable_advanced_logs_querying: false,
|
2020-10-24 23:57:45 +05:30
|
|
|
},
|
2020-07-28 23:09:34 +05:30
|
|
|
];
|
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
export const mockPodName = 'production-764c58d697-aaaaa';
|
|
|
|
export const mockPods = [
|
|
|
|
mockPodName,
|
|
|
|
'production-764c58d697-bbbbb',
|
|
|
|
'production-764c58d697-ccccc',
|
|
|
|
'production-764c58d697-ddddd',
|
|
|
|
];
|
|
|
|
|
|
|
|
export const mockLogsResult = [
|
2020-04-22 19:07:51 +05:30
|
|
|
{
|
|
|
|
timestamp: '2019-12-13T13:43:18.2760123Z',
|
|
|
|
message: 'log line 1',
|
|
|
|
pod: 'foo',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
timestamp: '2019-12-13T13:43:18.2760123Z',
|
|
|
|
message: 'log line A',
|
|
|
|
pod: 'bar',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
timestamp: '2019-12-13T13:43:26.8420123Z',
|
|
|
|
message: 'log line 2',
|
|
|
|
pod: 'foo',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
timestamp: '2019-12-13T13:43:26.8420123Z',
|
|
|
|
message: 'log line B',
|
|
|
|
pod: 'bar',
|
|
|
|
},
|
2020-04-08 14:13:33 +05:30
|
|
|
];
|
|
|
|
|
|
|
|
export const mockTrace = [
|
2020-04-22 19:07:51 +05:30
|
|
|
'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-04-08 14:13:33 +05:30
|
|
|
];
|
|
|
|
|
|
|
|
export const mockResponse = {
|
|
|
|
pod_name: mockPodName,
|
|
|
|
pods: mockPods,
|
|
|
|
logs: mockLogsResult,
|
|
|
|
cursor: mockNextCursor,
|
|
|
|
};
|
|
|
|
|
|
|
|
export const mockSearch = 'foo +bar';
|