Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-codepipeline-actions/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ nyc.config.js
*.snk
!.eslintrc.js

junit.xml
junit.xml
!jest.config.js
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-codepipeline-actions/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ tsconfig.json
# exclude cdk artifacts
**/cdk.out
junit.xml
test/
test/
jest.config.js
2 changes: 2 additions & 0 deletions packages/@aws-cdk/aws-codepipeline-actions/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const baseConfig = require('cdk-build-tools/config/jest.config');
module.exports = baseConfig;
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-codepipeline-actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,10 @@
"@aws-cdk/assert": "0.0.0",
"@aws-cdk/aws-cloudtrail": "0.0.0",
"@types/lodash": "^4.14.168",
"@types/nodeunit": "^0.0.31",
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
"lodash": "^4.17.21",
"nodeunit": "^0.11.3",
"nodeunit-shim": "0.0.0",
"pkglint": "0.0.0"
},
"dependencies": {
Expand Down Expand Up @@ -177,6 +176,7 @@
},
"maturity": "stable",
"cdk-build": {
"jest": true,
"env": {
"AWSLINT_BASE_CONSTRUCT": true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { expect, haveResourceLike } from '@aws-cdk/assert';
import * as codebuild from '@aws-cdk/aws-codebuild';
import * as codepipeline from '@aws-cdk/aws-codepipeline';
import { Stack } from '@aws-cdk/core';
import { Test } from 'nodeunit';
import { nodeunitShim, Test } from 'nodeunit-shim';
import * as cpactions from '../../lib';

/* eslint-disable quote-props */

export = {
nodeunitShim({
'BitBucket source Action': {
'produces the correct configuration when added to a pipeline'(test: Test) {
const stack = new Stack();
Expand Down Expand Up @@ -82,7 +82,7 @@ export = {

test.done();
},
};
});

function createBitBucketAndCodeBuildPipeline(stack: Stack, props: { codeBuildCloneOutput: boolean }): void {
const sourceOutput = new codepipeline.Artifact();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import * as codecommit from '@aws-cdk/aws-codecommit';
import * as codepipeline from '@aws-cdk/aws-codepipeline';
import { PolicyStatement, Role, ServicePrincipal } from '@aws-cdk/aws-iam';
import * as cdk from '@aws-cdk/core';
import { Test } from 'nodeunit';
import { nodeunitShim, Test } from 'nodeunit-shim';
import * as cpactions from '../../lib';

/* eslint-disable quote-props */

export = {
nodeunitShim({
'CreateChangeSetAction can be used to make a change set from a CodePipeline'(test: Test) {
const stack = new cdk.Stack();

Expand Down Expand Up @@ -712,7 +712,7 @@ export = {
test.done();
},
},
};
});

/**
* A test stack with a half-prepared pipeline ready to add CloudFormation actions to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import * as s3 from '@aws-cdk/aws-s3';
import * as cdk from '@aws-cdk/core';
import * as constructs from 'constructs';
import * as _ from 'lodash';
import * as nodeunit from 'nodeunit';
import { nodeunitShim, Test } from 'nodeunit-shim';
import * as cpactions from '../../lib';

export = nodeunit.testCase({
nodeunitShim({
CreateReplaceChangeSet: {
'works'(test: nodeunit.Test) {
'works'(test: Test) {
const app = new cdk.App();
const stack = new cdk.Stack(app, 'Stack');
const pipelineRole = new RoleDouble(stack, 'PipelineRole');
Expand Down Expand Up @@ -51,7 +51,7 @@ export = nodeunit.testCase({
test.done();
},

'uses a single permission statement if the same ChangeSet name is used'(test: nodeunit.Test) {
'uses a single permission statement if the same ChangeSet name is used'(test: Test) {
const stack = new cdk.Stack();
const pipelineRole = new RoleDouble(stack, 'PipelineRole');
const artifact = new codepipeline.Artifact('TestArtifact');
Expand Down Expand Up @@ -110,7 +110,7 @@ export = nodeunit.testCase({
},

ExecuteChangeSet: {
'works'(test: nodeunit.Test) {
'works'(test: Test) {
const stack = new cdk.Stack();
const pipelineRole = new RoleDouble(stack, 'PipelineRole');
const stage = new StageDouble({
Expand All @@ -137,7 +137,7 @@ export = nodeunit.testCase({
test.done();
},

'uses a single permission statement if the same ChangeSet name is used'(test: nodeunit.Test) {
'uses a single permission statement if the same ChangeSet name is used'(test: Test) {
const stack = new cdk.Stack();
const pipelineRole = new RoleDouble(stack, 'PipelineRole');
new StageDouble({
Expand Down Expand Up @@ -181,7 +181,7 @@ export = nodeunit.testCase({
},
},

'the CreateUpdateStack Action sets the DescribeStack*, Create/Update/DeleteStack & PassRole permissions'(test: nodeunit.Test) {
'the CreateUpdateStack Action sets the DescribeStack*, Create/Update/DeleteStack & PassRole permissions'(test: Test) {
const stack = new cdk.Stack();
const pipelineRole = new RoleDouble(stack, 'PipelineRole');
const action = new cpactions.CloudFormationCreateUpdateStackAction({
Expand All @@ -207,7 +207,7 @@ export = nodeunit.testCase({
test.done();
},

'the DeleteStack Action sets the DescribeStack*, DeleteStack & PassRole permissions'(test: nodeunit.Test) {
'the DeleteStack Action sets the DescribeStack*, DeleteStack & PassRole permissions'(test: Test) {
const stack = new cdk.Stack();
const pipelineRole = new RoleDouble(stack, 'PipelineRole');
const action = new cpactions.CloudFormationDeleteStackAction({
Expand Down Expand Up @@ -238,7 +238,7 @@ interface PolicyStatementJson {
}

function _assertActionMatches(
test: nodeunit.Test,
test: Test,
stack: cdk.Stack,
actions: FullAction[],
provider: string,
Expand Down Expand Up @@ -279,7 +279,7 @@ function _hasAction(
}

function _assertPermissionGranted(
test: nodeunit.Test,
test: Test,
stack: cdk.Stack,
statements: iam.PolicyStatement[],
action: string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import * as codepipeline from '@aws-cdk/aws-codepipeline';
import * as s3 from '@aws-cdk/aws-s3';
import * as sns from '@aws-cdk/aws-sns';
import { App, SecretValue, Stack } from '@aws-cdk/core';
import { Test } from 'nodeunit';
import { nodeunitShim, Test } from 'nodeunit-shim';
import * as cpactions from '../../lib';

/* eslint-disable quote-props */

export = {
nodeunitShim({
'CodeBuild action': {
'that is cross-account and has outputs': {
'causes an error'(test: Test) {
Expand Down Expand Up @@ -337,4 +337,4 @@ export = {
},
},
},
};
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import * as codecommit from '@aws-cdk/aws-codecommit';
import * as codepipeline from '@aws-cdk/aws-codepipeline';
import * as iam from '@aws-cdk/aws-iam';
import { Stack, Lazy } from '@aws-cdk/core';
import { Test } from 'nodeunit';
import { nodeunitShim, Test } from 'nodeunit-shim';
import * as cpactions from '../../lib';

/* eslint-disable quote-props */

export = {
nodeunitShim({
'CodeCommit Source Action': {
'by default does not poll for source changes and uses Events'(test: Test) {
const stack = new Stack();
Expand Down Expand Up @@ -430,7 +430,7 @@ export = {
test.done();
},
},
};
});

function minimalPipeline(stack: Stack, trigger: cpactions.CodeCommitTrigger | undefined): codepipeline.Pipeline {
const sourceOutput = new codepipeline.Artifact();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { expect, haveResourceLike } from '@aws-cdk/assert';
import * as codedeploy from '@aws-cdk/aws-codedeploy';
import * as codepipeline from '@aws-cdk/aws-codepipeline';
import * as cdk from '@aws-cdk/core';
import { Test } from 'nodeunit';
import { nodeunitShim, Test } from 'nodeunit-shim';
import * as cpactions from '../../lib';

export = {
nodeunitShim({
'CodeDeploy ECS Deploy Action': {
'throws an exception if more than 4 container image inputs are provided'(test: Test) {
const stack = new cdk.Stack();
Expand Down Expand Up @@ -198,7 +198,7 @@ export = {
test.done();
},
},
};
});

function addEcsDeploymentGroup(stack: cdk.Stack): codedeploy.IEcsDeploymentGroup {
return codedeploy.EcsDeploymentGroup.fromEcsDeploymentGroupAttributes(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import * as codebuild from '@aws-cdk/aws-codebuild';
import * as codepipeline from '@aws-cdk/aws-codepipeline';
import * as ecr from '@aws-cdk/aws-ecr';
import { Stack } from '@aws-cdk/core';
import { Test } from 'nodeunit';
import { nodeunitShim, Test } from 'nodeunit-shim';
import * as cpactions from '../../lib';

/* eslint-disable quote-props */

export = {
nodeunitShim({
'ECR source Action': {
'exposes variables for other actions to consume'(test: Test) {
const stack = new Stack();
Expand Down Expand Up @@ -63,4 +63,4 @@ export = {
test.done();
},
},
};
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import * as ec2 from '@aws-cdk/aws-ec2';
import * as ecs from '@aws-cdk/aws-ecs';
import * as s3 from '@aws-cdk/aws-s3';
import * as cdk from '@aws-cdk/core';
import { Test } from 'nodeunit';
import { nodeunitShim, Test } from 'nodeunit-shim';
import * as cpactions from '../../lib';

export = {
nodeunitShim({
'ECS deploy Action': {
'throws an exception if neither inputArtifact nor imageFile were provided'(test: Test) {
const service = anyEcsService();
Expand Down Expand Up @@ -198,7 +198,7 @@ export = {
test.done();
},
},
};
});

function anyEcsService(): ecs.FargateService {
const stack = new cdk.Stack();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { expect, haveResourceLike, SynthUtils } from '@aws-cdk/assert';
import * as codebuild from '@aws-cdk/aws-codebuild';
import * as codepipeline from '@aws-cdk/aws-codepipeline';
import { SecretValue, Stack } from '@aws-cdk/core';
import { Test } from 'nodeunit';
import { nodeunitShim, Test } from 'nodeunit-shim';
import * as cpactions from '../../lib';

/* eslint-disable quote-props */

export = {
nodeunitShim({
'GitHub source Action': {
'exposes variables for other actions to consume'(test: Test) {
const stack = new Stack();
Expand Down Expand Up @@ -208,4 +208,4 @@ export = {
test.done();
},
},
};
});
Loading