Skip to content

Commit

Permalink
Merge branch 'master' into upparekh/publish-service-extension
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Sep 17, 2021
2 parents a6eb709 + 124a7a1 commit e76126c
Show file tree
Hide file tree
Showing 96 changed files with 13,916 additions and 2,616 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/issue-label-assign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
issues: write
runs-on: ubuntu-latest
steps:
- uses: Naturalclar/issue-action@v2.0.2
- uses: peterwoodworth/issue-action@main
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
title-or-body: 'title'
excluded-expressions: "[CDK CLI Version|TypeScript|Java|Python]"
parameters: >
[
{"keywords":["(cli)","(command line)"],"labels":["package/tools"],"assignees":["rix0rrr"]},
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [1.123.0](https://github.com/aws/aws-cdk/compare/v1.122.0...v1.123.0) (2021-09-16)


### Features

* **opensearch:** rebrand Elasticsearch as OpenSearch ([e6c4ca5](https://github.com/aws/aws-cdk/commit/e6c4ca5e71934e890eabe41190e9c2d0bd42aefb)), closes [aws/aws-cdk#16467](https://github.com/aws/aws-cdk/issues/16467)

## [1.122.0](https://github.com/aws/aws-cdk/compare/v1.121.0...v1.122.0) (2021-09-08)

### ⚠ BREAKING CHANGES TO EXPERIMENTAL FEATURES
Expand Down
3 changes: 2 additions & 1 deletion packages/@aws-cdk/assets/.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/assets/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ tsconfig.json
**/cdk.out
junit.xml
test/
!*.lit.ts
!*.lit.ts
jest.config.js
2 changes: 2 additions & 0 deletions packages/@aws-cdk/assets/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const baseConfig = require('../../../tools/cdk-build-tools/config/jest.config');
module.exports = baseConfig;
7 changes: 4 additions & 3 deletions packages/@aws-cdk/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
"cdk-build": {
"pre": [
"rm -rf test/fs/fixtures && cd test/fs && tar -xzvf fixtures.tar.gz"
]
],
"jest": true
},
"keywords": [
"aws",
Expand All @@ -69,12 +70,12 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/nodeunit": "^0.0.32",
"@types/jest": "^26.0.24",
"@types/sinon": "^9.0.11",
"aws-cdk": "0.0.0",
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
"nodeunit": "^0.11.3",
"jest": "^26.6.3",
"pkglint": "0.0.0",
"sinon": "^9.2.4",
"ts-mock-imports": "^1.3.7",
Expand Down
12 changes: 12 additions & 0 deletions packages/@aws-cdk/assets/test/compat.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { SymlinkFollowMode } from '@aws-cdk/core';
import '@aws-cdk/assert-internal/jest';
import { FollowMode } from '../lib';
import { toSymlinkFollow } from '../lib/compat';

test('FollowMode compatibility', () => {
expect(toSymlinkFollow(undefined)).toEqual(undefined);
expect(toSymlinkFollow(FollowMode.ALWAYS)).toEqual(SymlinkFollowMode.ALWAYS);
expect(toSymlinkFollow(FollowMode.BLOCK_EXTERNAL)).toEqual(SymlinkFollowMode.BLOCK_EXTERNAL);
expect(toSymlinkFollow(FollowMode.EXTERNAL)).toEqual(SymlinkFollowMode.EXTERNAL);
expect(toSymlinkFollow(FollowMode.NEVER)).toEqual(SymlinkFollowMode.NEVER);
});
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,24 @@ import * as fs from 'fs';
import * as path from 'path';
import { App, Stack } from '@aws-cdk/core';
import * as cxapi from '@aws-cdk/cx-api';
import { Test } from 'nodeunit';
import '@aws-cdk/assert-internal/jest';
import { Staging } from '../lib';

export = {
'base case'(test: Test) {
describe('staging', () => {
test('base case', () => {
// GIVEN
const stack = new Stack();
const sourcePath = path.join(__dirname, 'fs', 'fixtures', 'test1');

// WHEN
const staging = new Staging(stack, 's1', { sourcePath });

test.deepEqual(staging.assetHash, '2f37f937c51e2c191af66acf9b09f548926008ec68c575bd2ee54b6e997c0e00');
test.deepEqual(staging.sourcePath, sourcePath);
test.deepEqual(staging.relativeStagedPath(stack), 'asset.2f37f937c51e2c191af66acf9b09f548926008ec68c575bd2ee54b6e997c0e00');
test.done();
},
expect(staging.assetHash).toEqual('2f37f937c51e2c191af66acf9b09f548926008ec68c575bd2ee54b6e997c0e00');
expect(staging.sourcePath).toEqual(sourcePath);
expect(staging.relativeStagedPath(stack)).toEqual('asset.2f37f937c51e2c191af66acf9b09f548926008ec68c575bd2ee54b6e997c0e00');
});

'staging can be disabled through context'(test: Test) {
test('staging can be disabled through context', () => {
// GIVEN
const stack = new Stack();
stack.node.setContext(cxapi.DISABLE_ASSET_STAGING_CONTEXT, true);
Expand All @@ -29,13 +28,12 @@ export = {
// WHEN
const staging = new Staging(stack, 's1', { sourcePath });

test.deepEqual(staging.assetHash, '2f37f937c51e2c191af66acf9b09f548926008ec68c575bd2ee54b6e997c0e00');
test.deepEqual(staging.sourcePath, sourcePath);
test.deepEqual(staging.absoluteStagedPath, sourcePath);
test.done();
},
expect(staging.assetHash).toEqual('2f37f937c51e2c191af66acf9b09f548926008ec68c575bd2ee54b6e997c0e00');
expect(staging.sourcePath).toEqual(sourcePath);
expect(staging.absoluteStagedPath).toEqual(sourcePath);
});

'files are copied to the output directory during synth'(test: Test) {
test('files are copied to the output directory during synth', () => {
// GIVEN
const app = new App();
const stack = new Stack(app, 'stack');
Expand All @@ -48,18 +46,17 @@ export = {

// THEN
const assembly = app.synth();
test.deepEqual(fs.readdirSync(assembly.directory), [
expect(fs.readdirSync(assembly.directory)).toEqual([
'asset.2f37f937c51e2c191af66acf9b09f548926008ec68c575bd2ee54b6e997c0e00',
'asset.af10ac04b3b607b0f8659c8f0cee8c343025ee75baf0b146f10f0e5311d2c46b.gz',
'cdk.out',
'manifest.json',
'stack.template.json',
'tree.json',
]);
test.done();
},
});

'allow specifying extra data to include in the source hash'(test: Test) {
test('allow specifying extra data to include in the source hash', () => {
// GIVEN
const app = new App();
const stack = new Stack(app, 'stack');
Expand All @@ -70,9 +67,8 @@ export = {
const withExtra = new Staging(stack, 'withExtra', { sourcePath: directory, extraHash: 'boom' });

// THEN
test.notEqual(withoutExtra.assetHash, withExtra.assetHash);
test.deepEqual(withoutExtra.assetHash, '2f37f937c51e2c191af66acf9b09f548926008ec68c575bd2ee54b6e997c0e00');
test.deepEqual(withExtra.assetHash, 'c95c915a5722bb9019e2c725d11868e5a619b55f36172f76bcbcaa8bb2d10c5f');
test.done();
},
};
expect(withoutExtra.assetHash).not.toEqual(withExtra.assetHash);
expect(withoutExtra.assetHash).toEqual('2f37f937c51e2c191af66acf9b09f548926008ec68c575bd2ee54b6e997c0e00');
expect(withExtra.assetHash).toEqual('c95c915a5722bb9019e2c725d11868e5a619b55f36172f76bcbcaa8bb2d10c5f');
});
});
15 changes: 0 additions & 15 deletions packages/@aws-cdk/assets/test/test.compat.ts

This file was deleted.

3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-codedeploy/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ nyc.config.js
!.eslintrc.js

junit.xml
!test/lambda/*/*.js
!test/lambda/*/*.js
!jest.config.js
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-codedeploy/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ tsconfig.json
**/cdk.out
junit.xml
test/
!*.lit.ts
!*.lit.ts
jest.config.js
2 changes: 2 additions & 0 deletions packages/@aws-cdk/aws-codedeploy/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const baseConfig = require('../../../tools/cdk-build-tools/config/jest.config');
module.exports = baseConfig;
5 changes: 3 additions & 2 deletions packages/@aws-cdk/aws-codedeploy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
},
"cdk-build": {
"cloudformation": "AWS::CodeDeploy",
"jest": true,
"env": {
"AWSLINT_BASE_CONSTRUCT": true
}
Expand All @@ -75,11 +76,11 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/nodeunit": "^0.0.32",
"@types/jest": "^26.0.24",
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
"cfn2ts": "0.0.0",
"nodeunit": "^0.11.3",
"jest": "^26.6.3",
"pkglint": "0.0.0",
"@aws-cdk/assert-internal": "0.0.0"
},
Expand Down
26 changes: 26 additions & 0 deletions packages/@aws-cdk/aws-codedeploy/test/ecs/application.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import '@aws-cdk/assert-internal/jest';
import * as cdk from '@aws-cdk/core';
import * as codedeploy from '../../lib';

describe('CodeDeploy ECS Application', () => {
test('can be created', () => {
const stack = new cdk.Stack();
new codedeploy.EcsApplication(stack, 'MyApp');

expect(stack).toHaveResource('AWS::CodeDeploy::Application', {
ComputePlatform: 'ECS',
});
});

test('can be created with explicit name', () => {
const stack = new cdk.Stack();
new codedeploy.EcsApplication(stack, 'MyApp', {
applicationName: 'my-name',
});

expect(stack).toHaveResource('AWS::CodeDeploy::Application', {
ApplicationName: 'my-name',
ComputePlatform: 'ECS',
});
});
});
18 changes: 18 additions & 0 deletions packages/@aws-cdk/aws-codedeploy/test/ecs/deployment-group.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import * as cdk from '@aws-cdk/core';
import * as codedeploy from '../../lib';

describe('CodeDeploy ECS DeploymentGroup', () => {
describe('imported with fromEcsDeploymentGroupAttributes', () => {
test('defaults the Deployment Config to AllAtOnce', () => {
const stack = new cdk.Stack();

const ecsApp = codedeploy.EcsApplication.fromEcsApplicationName(stack, 'EA', 'EcsApplication');
const importedGroup = codedeploy.EcsDeploymentGroup.fromEcsDeploymentGroupAttributes(stack, 'EDG', {
application: ecsApp,
deploymentGroupName: 'EcsDeploymentGroup',
});

expect(importedGroup.deploymentConfig).toEqual(codedeploy.EcsDeploymentConfig.ALL_AT_ONCE);
});
});
});
33 changes: 0 additions & 33 deletions packages/@aws-cdk/aws-codedeploy/test/ecs/test.application.ts

This file was deleted.

23 changes: 0 additions & 23 deletions packages/@aws-cdk/aws-codedeploy/test/ecs/test.deployment-group.ts

This file was deleted.

24 changes: 24 additions & 0 deletions packages/@aws-cdk/aws-codedeploy/test/lambda/application.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import '@aws-cdk/assert-internal/jest';
import * as cdk from '@aws-cdk/core';
import * as codedeploy from '../../lib';

describe('CodeDeploy Lambda Application', () => {
test('can be created', () => {
const stack = new cdk.Stack();
new codedeploy.LambdaApplication(stack, 'MyApp');
expect(stack).toHaveResource('AWS::CodeDeploy::Application', {
ComputePlatform: 'Lambda',
});
});

test('can be created with explicit name', () => {
const stack = new cdk.Stack();
new codedeploy.LambdaApplication(stack, 'MyApp', {
applicationName: 'my-name',
});
expect(stack).toHaveResource('AWS::CodeDeploy::Application', {
ApplicationName: 'my-name',
ComputePlatform: 'Lambda',
});
});
});
Loading

0 comments on commit e76126c

Please sign in to comment.