Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support new CI job names #34

Merged
merged 1 commit into from
Mar 30, 2023
Merged
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
14 changes: 10 additions & 4 deletions services/test-results.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ interface Context {
now: () => Date;
}

const testResultJobsNames = ['e2e-sandboxes', 'test-runner-sandboxes'];
const testResultJobsNames = [
'test-runner-production',
'e2e-production',
// These job names got renamed, but we need to maintain them for some time to keep the data consistent
'test-runner-sandboxes',
'e2e-sandboxes',
];

export async function getLatestTestResults(ctx: Context): Promise<TemplateTests[]> {
const pipelines: EnrichedPipeline[] = await ctx.getDailyPipelines('next');
Expand Down Expand Up @@ -153,7 +159,7 @@ function getRelevantTests(pipeline: EnrichedPipeline, templates: string[]) {
}

function getFeature(jobName: string, className: string) {
if (jobName === 'e2e-sandboxes') {
if (jobName === 'e2e-sandboxes' || jobName === 'e2e-production') {
const feature = className.split(' › ')[2];
if (feature == null) return 'core';

Expand All @@ -163,7 +169,7 @@ function getFeature(jobName: string, className: string) {
}
return 'core';
}
if (jobName === 'test-runner-sandboxes') {
if (jobName === 'test-runner-sandboxes' || jobName === 'test-runner-production') {
const feature = className.split(' ')[1];
if (feature.includes('addons/')) return `addon-${feature.split('/')[1]}`;
return 'core';
Expand All @@ -178,6 +184,6 @@ function getAllTemplatesNames(pipeline: EnrichedPipeline) {
}

function isPipelineCompleted(pipeline: EnrichedPipeline) {
const testResultsJobs = testResultJobsNames.map((name) => pipeline.jobs.find((it) => it.name === name));
const testResultsJobs = testResultJobsNames.map((name) => pipeline.jobs.find((it) => it.name === name)).filter(Boolean);
return testResultsJobs.every((it) => it?.status === 'success' || it?.status === 'failed');
}