Fix Pipleine cypress issue (#7654)

This commit is contained in:
Ashish Gupta 2022-09-22 19:12:19 +05:30 committed by GitHub
parent 169ad3c687
commit b7471ab5aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 3 deletions

View File

@ -21,6 +21,7 @@ import { Paging } from '../generated/type/paging';
import { ServicePageData } from '../pages/service';
import { getURLWithQueryFields } from '../utils/APIUtils';
import APIClient from './index';
import { ListTestCaseResultsParams } from './testAPI';
export const getPipelineVersions = async (id: string) => {
const url = `/pipelines/${id}/versions`;
@ -123,11 +124,15 @@ export const patchPipelineDetails = async (id: string, data: Operation[]) => {
return response.data;
};
export const getPipelineStatus = async (fqn: string) => {
export const getPipelineStatus = async (
fqn: string,
params?: ListTestCaseResultsParams
) => {
const url = `/pipelines/${fqn}/status`;
const response = await APIClient.get<PagingResponse<Array<PipelineStatus>>>(
url
url,
{ params }
);
return response.data;

View File

@ -14,6 +14,7 @@
import { Space } from 'antd';
import { AxiosError } from 'axios';
import { isEmpty, isNil } from 'lodash';
import moment from 'moment';
import React, {
FC,
Fragment,
@ -24,6 +25,7 @@ import React, {
} from 'react';
import Select, { SingleValue } from 'react-select';
import { getPipelineStatus } from '../../axiosAPIs/pipelineAPI';
import { PROFILER_FILTER_RANGE } from '../../constants/profiler.constant';
import { Pipeline, PipelineStatus } from '../../generated/entity/data/pipeline';
import jsonData from '../../jsons/en';
import { STATUS_OPTIONS } from '../../utils/PipelineDetailsUtils';
@ -73,7 +75,15 @@ const PipelineStatusList: FC<Prop> = ({
const fetchPipelineStatus = async () => {
try {
const response = await getPipelineStatus(pipelineFQN);
const startTs = moment()
.subtract(PROFILER_FILTER_RANGE.last60days.days, 'days')
.unix();
const endTs = moment().unix();
const response = await getPipelineStatus(pipelineFQN, {
startTs,
endTs,
});
setExecutions(response.data);
} catch (error) {
showErrorToast(