Skip to content

Commit

Permalink
chore: add retries to validation test to reduce flakiness (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmanciop authored Nov 7, 2023
1 parent 33c7e4b commit ab7966d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion packages/otelbin-validation/.projenrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const project = new awscdk.AwsCdkTypeScriptApp({
defaultReleaseBranch: 'main',
name: 'otelbin-validation',
deps: ['aws-lambda'],
devDeps: ['@jest/globals', '@types/aws-lambda', 'axios', 'esbuild'],
devDeps: ['@jest/globals', '@types/aws-lambda', 'axios', 'esbuild', 'jest-circus'],
github: false, // Skip GitHub integration, as this CDK app is not in the repo's root
packageManager: 'npm',
eslintOptions: {
Expand All @@ -17,5 +17,10 @@ const project = new awscdk.AwsCdkTypeScriptApp({
'src/images/otelcol-validator/',
],
},
jestOptions: {
jestConfig: {
testRunner: 'jest-circus/runner',
},
},
});
project.synth();
1 change: 1 addition & 0 deletions packages/otelbin-validation/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/otelbin-validation/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion packages/otelbin-validation/test/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import { readFileSync } from 'fs';
import { join } from 'path';
import { describe, expect, test } from '@jest/globals';
import { describe, expect, jest, test } from '@jest/globals';
import axios from 'axios';
import { Distributions } from '../src/main';

Expand Down Expand Up @@ -56,6 +56,8 @@ const otelcolConfigInvalidUndeclaredReceiver = readConfig('config-undeclared-rec

describe.each(enumerateTestCases())('Validation API', (distributionName, release) => {

jest.retryTimes(5);

const validationReleasePath = `validation/${distributionName}/${release}`;
const validationUrl = `${apiUrl}/${validationReleasePath}`;

Expand Down

0 comments on commit ab7966d

Please sign in to comment.