Skip to content

Commit

Permalink
chore(pkglint): Add build:test and build:test:package scripts (#2602)
Browse files Browse the repository at this point in the history
Adds a `build:test` and `build:test:package` script to all packages so that they can be easily be built and tested (and optionally packaged) in topological order using a single command (`lerna run build:test` or `lerna run build:test:package`).

This allows failing faster, as packages not passing unit tests will not even be built.
  • Loading branch information
RomainMuller committed May 21, 2019
1 parent 64c3c6b commit 96c2842
Show file tree
Hide file tree
Showing 125 changed files with 391 additions and 134 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ env:
before_install:
- nvm install $NODE_VERSION

cache:
- npm
- pip

install: ./install.sh
script: ./build.sh

8 changes: 1 addition & 7 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ trap "rm -rf $MERKLE_BUILD_CACHE" EXIT

echo "============================================================================================="
echo "building..."
time lerna run $bail --stream build || fail

if $run_tests; then
echo "============================================================================================="
echo "testing..."
lerna run $bail --stream test || fail
fi
time lerna run $bail --stream build+test || fail

touch $BUILD_INDICATOR
4 changes: 3 additions & 1 deletion packages/@aws-cdk/alexa-ask/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@
"test": "cdk-test",
"watch": "cdk-watch",
"awslint": "cdk-awslint",
"cfn2ts": "cfn2ts"
"cfn2ts": "cfn2ts",
"build+test+package": "npm run build+test && npm run package",
"build+test": "npm run build && npm test"
},
"cdk-build": {
"cloudformation": "Alexa::ASK"
Expand Down
4 changes: 3 additions & 1 deletion packages/@aws-cdk/app-delivery/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
"test": "cdk-test",
"watch": "cdk-watch",
"integ": "cdk-integ",
"awslint": "cdk-awslint"
"awslint": "cdk-awslint",
"build+test+package": "npm run build+test && npm run package",
"build+test": "npm run build && npm test"
},
"dependencies": {
"@aws-cdk/aws-cloudformation": "^0.31.0",
Expand Down
4 changes: 3 additions & 1 deletion packages/@aws-cdk/applet-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
"lint": "cdk-lint",
"test": "cdk-test",
"pkglint": "pkglint -f",
"package": "cdk-package"
"package": "cdk-package",
"build+test+package": "npm run build+test && npm run package",
"build+test": "npm run build && npm test"
},
"author": {
"name": "Amazon Web Services",
Expand Down
4 changes: 3 additions & 1 deletion packages/@aws-cdk/assert/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"lint": "cdk-lint",
"test": "cdk-test",
"pkglint": "pkglint -f",
"package": "cdk-package"
"package": "cdk-package",
"build+test+package": "npm run build+test && npm run package",
"build+test": "npm run build && npm test"
},
"nyc": {
"statements": 40,
Expand Down
4 changes: 3 additions & 1 deletion packages/@aws-cdk/assets-docker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
"integ": "cdk-integ",
"pkglint": "pkglint -f",
"package": "cdk-package",
"awslint": "cdk-awslint"
"awslint": "cdk-awslint",
"build+test+package": "npm run build+test && npm run package",
"build+test": "npm run build && npm test"
},
"keywords": [
"aws",
Expand Down
4 changes: 3 additions & 1 deletion packages/@aws-cdk/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
"integ": "cdk-integ",
"pkglint": "pkglint -f",
"package": "cdk-package",
"awslint": "cdk-awslint"
"awslint": "cdk-awslint",
"build+test+package": "npm run build+test && npm run package",
"build+test": "npm run build && npm test"
},
"cdk-build": {
"pre": [
Expand Down
4 changes: 3 additions & 1 deletion packages/@aws-cdk/aws-amazonmq/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@
"test": "cdk-test",
"watch": "cdk-watch",
"awslint": "cdk-awslint",
"cfn2ts": "cfn2ts"
"cfn2ts": "cfn2ts",
"build+test+package": "npm run build+test && npm run package",
"build+test": "npm run build && npm test"
},
"cdk-build": {
"cloudformation": "AWS::AmazonMQ"
Expand Down
4 changes: 3 additions & 1 deletion packages/@aws-cdk/aws-apigateway/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
"pkglint": "pkglint -f",
"package": "cdk-package",
"awslint": "cdk-awslint",
"cfn2ts": "cfn2ts"
"cfn2ts": "cfn2ts",
"build+test+package": "npm run build+test && npm run package",
"build+test": "npm run build && npm test"
},
"cdk-build": {
"cloudformation": [
Expand Down
4 changes: 3 additions & 1 deletion packages/@aws-cdk/aws-applicationautoscaling/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
"pkglint": "pkglint -f",
"package": "cdk-package",
"awslint": "cdk-awslint",
"cfn2ts": "cfn2ts"
"cfn2ts": "cfn2ts",
"build+test+package": "npm run build+test && npm run package",
"build+test": "npm run build && npm test"
},
"cdk-build": {
"cloudformation": "AWS::ApplicationAutoScaling"
Expand Down
4 changes: 3 additions & 1 deletion packages/@aws-cdk/aws-appmesh/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@
"pkglint": "pkglint -f",
"test": "cdk-test",
"watch": "cdk-watch",
"cfn2ts": "cfn2ts"
"cfn2ts": "cfn2ts",
"build+test+package": "npm run build+test && npm run package",
"build+test": "npm run build && npm test"
},
"cdk-build": {
"cloudformation": "AWS::AppMesh"
Expand Down
4 changes: 3 additions & 1 deletion packages/@aws-cdk/aws-appstream/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@
"test": "cdk-test",
"watch": "cdk-watch",
"awslint": "cdk-awslint",
"cfn2ts": "cfn2ts"
"cfn2ts": "cfn2ts",
"build+test+package": "npm run build+test && npm run package",
"build+test": "npm run build && npm test"
},
"cdk-build": {
"cloudformation": "AWS::AppStream"
Expand Down
4 changes: 3 additions & 1 deletion packages/@aws-cdk/aws-appsync/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
"pkglint": "pkglint -f",
"package": "cdk-package",
"awslint": "cdk-awslint",
"cfn2ts": "cfn2ts"
"cfn2ts": "cfn2ts",
"build+test+package": "npm run build+test && npm run package",
"build+test": "npm run build && npm test"
},
"cdk-build": {
"cloudformation": "AWS::AppSync"
Expand Down
4 changes: 3 additions & 1 deletion packages/@aws-cdk/aws-athena/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@
"pkglint": "pkglint -f",
"package": "cdk-package",
"awslint": "cdk-awslint",
"cfn2ts": "cfn2ts"
"cfn2ts": "cfn2ts",
"build+test+package": "npm run build+test && npm run package",
"build+test": "npm run build && npm test"
},
"keywords": [
"aws",
Expand Down
4 changes: 3 additions & 1 deletion packages/@aws-cdk/aws-autoscaling-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
"integ": "cdk-integ",
"pkglint": "pkglint -f",
"package": "cdk-package",
"awslint": "cdk-awslint"
"awslint": "cdk-awslint",
"build+test+package": "npm run build+test && npm run package",
"build+test": "npm run build && npm test"
},
"keywords": [
"aws",
Expand Down
4 changes: 3 additions & 1 deletion packages/@aws-cdk/aws-autoscaling-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
"integ": "cdk-integ",
"pkglint": "pkglint -f",
"package": "cdk-package",
"awslint": "cdk-awslint"
"awslint": "cdk-awslint",
"build+test+package": "npm run build+test && npm run package",
"build+test": "npm run build && npm test"
},
"keywords": [
"aws",
Expand Down
4 changes: 3 additions & 1 deletion packages/@aws-cdk/aws-autoscaling/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
"pkglint": "pkglint -f",
"package": "cdk-package",
"awslint": "cdk-awslint",
"cfn2ts": "cfn2ts"
"cfn2ts": "cfn2ts",
"build+test+package": "npm run build+test && npm run package",
"build+test": "npm run build && npm test"
},
"cdk-build": {
"cloudformation": "AWS::AutoScaling"
Expand Down
4 changes: 3 additions & 1 deletion packages/@aws-cdk/aws-autoscalingplans/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
"pkglint": "pkglint -f",
"package": "cdk-package",
"awslint": "cdk-awslint",
"cfn2ts": "cfn2ts"
"cfn2ts": "cfn2ts",
"build+test+package": "npm run build+test && npm run package",
"build+test": "npm run build && npm test"
},
"cdk-build": {
"cloudformation": "AWS::AutoScalingPlans"
Expand Down
4 changes: 3 additions & 1 deletion packages/@aws-cdk/aws-batch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
"pkglint": "pkglint -f",
"package": "cdk-package",
"awslint": "cdk-awslint",
"cfn2ts": "cfn2ts"
"cfn2ts": "cfn2ts",
"build+test+package": "npm run build+test && npm run package",
"build+test": "npm run build && npm test"
},
"cdk-build": {
"cloudformation": "AWS::Batch"
Expand Down
4 changes: 3 additions & 1 deletion packages/@aws-cdk/aws-budgets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
"pkglint": "pkglint -f",
"package": "cdk-package",
"awslint": "cdk-awslint",
"cfn2ts": "cfn2ts"
"cfn2ts": "cfn2ts",
"build+test+package": "npm run build+test && npm run package",
"build+test": "npm run build && npm test"
},
"cdk-build": {
"cloudformation": "AWS::Budgets"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"scripts": {
"build": "echo No build",
"test": "jest",
"lint": "eslint lib"
"lint": "eslint lib",
"build+test+package": "npm run build+test",
"build+test": "npm run build && npm test"
},
"keywords": [
"aws",
Expand Down
4 changes: 3 additions & 1 deletion packages/@aws-cdk/aws-certificatemanager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
"pkglint": "pkglint -f",
"package": "cdk-package",
"awslint": "cdk-awslint",
"cfn2ts": "cfn2ts"
"cfn2ts": "cfn2ts",
"build+test+package": "npm run build+test && npm run package",
"build+test": "npm run build && npm test"
},
"cdk-build": {
"cloudformation": "AWS::CertificateManager"
Expand Down
4 changes: 3 additions & 1 deletion packages/@aws-cdk/aws-cloud9/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
"pkglint": "pkglint -f",
"package": "cdk-package",
"awslint": "cdk-awslint",
"cfn2ts": "cfn2ts"
"cfn2ts": "cfn2ts",
"build+test+package": "npm run build+test && npm run package",
"build+test": "npm run build && npm test"
},
"cdk-build": {
"cloudformation": "AWS::Cloud9"
Expand Down
4 changes: 3 additions & 1 deletion packages/@aws-cdk/aws-cloudformation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
"pkglint": "pkglint -f",
"package": "cdk-package",
"awslint": "cdk-awslint",
"cfn2ts": "cfn2ts"
"cfn2ts": "cfn2ts",
"build+test+package": "npm run build+test && npm run package",
"build+test": "npm run build && npm test"
},
"cdk-build": {
"cloudformation": "AWS::CloudFormation"
Expand Down
4 changes: 3 additions & 1 deletion packages/@aws-cdk/aws-cloudfront/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
"pkglint": "pkglint -f",
"package": "cdk-package",
"awslint": "cdk-awslint",
"cfn2ts": "cfn2ts"
"cfn2ts": "cfn2ts",
"build+test+package": "npm run build+test && npm run package",
"build+test": "npm run build && npm test"
},
"cdk-build": {
"cloudformation": "AWS::CloudFront"
Expand Down
4 changes: 3 additions & 1 deletion packages/@aws-cdk/aws-cloudtrail/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
"package": "cdk-package",
"awslint": "cdk-awslint",
"cfn2ts": "cfn2ts",
"integ": "cdk-integ"
"integ": "cdk-integ",
"build+test+package": "npm run build+test && npm run package",
"build+test": "npm run build && npm test"
},
"cdk-build": {
"cloudformation": "AWS::CloudTrail"
Expand Down
4 changes: 3 additions & 1 deletion packages/@aws-cdk/aws-cloudwatch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
"pkglint": "pkglint -f",
"package": "cdk-package",
"awslint": "cdk-awslint",
"cfn2ts": "cfn2ts"
"cfn2ts": "cfn2ts",
"build+test+package": "npm run build+test && npm run package",
"build+test": "npm run build && npm test"
},
"cdk-build": {
"cloudformation": "AWS::CloudWatch"
Expand Down
4 changes: 3 additions & 1 deletion packages/@aws-cdk/aws-codebuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
"pkglint": "pkglint -f",
"package": "cdk-package",
"awslint": "cdk-awslint",
"cfn2ts": "cfn2ts"
"cfn2ts": "cfn2ts",
"build+test+package": "npm run build+test && npm run package",
"build+test": "npm run build && npm test"
},
"cdk-build": {
"cloudformation": "AWS::CodeBuild"
Expand Down
4 changes: 3 additions & 1 deletion packages/@aws-cdk/aws-codecommit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
"pkglint": "pkglint -f",
"package": "cdk-package",
"awslint": "cdk-awslint",
"cfn2ts": "cfn2ts"
"cfn2ts": "cfn2ts",
"build+test+package": "npm run build+test && npm run package",
"build+test": "npm run build && npm test"
},
"cdk-build": {
"cloudformation": "AWS::CodeCommit"
Expand Down
4 changes: 3 additions & 1 deletion packages/@aws-cdk/aws-codedeploy-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
"integ": "cdk-integ",
"pkglint": "pkglint -f",
"package": "cdk-package",
"awslint": "cdk-awslint"
"awslint": "cdk-awslint",
"build+test+package": "npm run build+test && npm run package",
"build+test": "npm run build && npm test"
},
"keywords": [
"aws",
Expand Down
4 changes: 3 additions & 1 deletion packages/@aws-cdk/aws-codedeploy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
"pkglint": "pkglint -f",
"package": "cdk-package",
"awslint": "cdk-awslint",
"cfn2ts": "cfn2ts"
"cfn2ts": "cfn2ts",
"build+test+package": "npm run build+test && npm run package",
"build+test": "npm run build && npm test"
},
"cdk-build": {
"cloudformation": "AWS::CodeDeploy"
Expand Down
4 changes: 3 additions & 1 deletion packages/@aws-cdk/aws-codepipeline-actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
"integ": "cdk-integ",
"pkglint": "pkglint -f",
"package": "cdk-package",
"awslint": "cdk-awslint"
"awslint": "cdk-awslint",
"build+test+package": "npm run build+test && npm run package",
"build+test": "npm run build && npm test"
},
"nyc": {
"statements": 70
Expand Down
4 changes: 3 additions & 1 deletion packages/@aws-cdk/aws-codepipeline/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
"pkglint": "pkglint -f",
"package": "cdk-package",
"awslint": "cdk-awslint",
"cfn2ts": "cfn2ts"
"cfn2ts": "cfn2ts",
"build+test+package": "npm run build+test && npm run package",
"build+test": "npm run build && npm test"
},
"cdk-build": {
"cloudformation": "AWS::CodePipeline"
Expand Down
4 changes: 3 additions & 1 deletion packages/@aws-cdk/aws-cognito/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
"pkglint": "pkglint -f",
"package": "cdk-package",
"awslint": "cdk-awslint",
"cfn2ts": "cfn2ts"
"cfn2ts": "cfn2ts",
"build+test+package": "npm run build+test && npm run package",
"build+test": "npm run build && npm test"
},
"cdk-build": {
"cloudformation": "AWS::Cognito"
Expand Down
4 changes: 3 additions & 1 deletion packages/@aws-cdk/aws-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
"pkglint": "pkglint -f",
"package": "cdk-package",
"awslint": "cdk-awslint",
"cfn2ts": "cfn2ts"
"cfn2ts": "cfn2ts",
"build+test+package": "npm run build+test && npm run package",
"build+test": "npm run build && npm test"
},
"cdk-build": {
"cloudformation": "AWS::Config"
Expand Down
Loading

0 comments on commit 96c2842

Please sign in to comment.