Skip to content

Commit

Permalink
🧑‍💻 Adds report group type property
Browse files Browse the repository at this point in the history
  • Loading branch information
daschaa committed May 2, 2022
1 parent 42a8947 commit c07ff3e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/@aws-cdk/aws-codebuild/lib/report-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,16 @@ export interface ReportGroupProps {
* @default RemovalPolicy.RETAIN
*/
readonly removalPolicy?: cdk.RemovalPolicy;

/**
* The type of report group. This can be one of the following values:
*
* - **TEST** - The report group contains test reports.
* - **CODE_COVERAGE** - The report group contains code coverage reports.
*
* @default - TEST
*/
readonly type?: 'TEST' | 'CODE_COVERAGE'
}

/**
Expand Down Expand Up @@ -125,7 +135,7 @@ export class ReportGroup extends ReportGroupBase {
});

const resource = new CfnReportGroup(this, 'Resource', {
type: 'TEST',
type: props.type ? props.type : 'TEST',
exportConfig: {
exportConfigType: props.exportBucket ? 'S3' : 'NO_EXPORT',
s3Destination: props.exportBucket
Expand Down
12 changes: 12 additions & 0 deletions packages/@aws-cdk/aws-codebuild/test/report-group.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,16 @@ describe('Test Reports Groups', () => {
"UpdateReplacePolicy": "Delete",
});
});

test('can be created with type=CODE_COVERAGE', () => {
const stack = new cdk.Stack();

new codebuild.ReportGroup(stack, 'ReportGroup', {
type: 'CODE_COVERAGE',
});

Template.fromStack(stack).hasResourceProperties('AWS::CodeBuild::ReportGroup', {
"Type": "CODE_COVERAGE",
});
});
});

0 comments on commit c07ff3e

Please sign in to comment.