Skip to content

Commit da54750

Browse files
committed
Add generated protocol tests
This commit adds the protocol tests generated by the protocol-test-codegen project to the repository. It enables their building and running through the use of new package level commands, build:protocols and test:protocols.
1 parent c627e2f commit da54750

File tree

196 files changed

+47963
-8
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

196 files changed

+47963
-8
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jspm_packages
1919
*.tgz
2020
.yarn-integrity
2121

22+
.vscode/launch.json
23+
2224
lerna-debug.log
2325
package-lock.json
2426

@@ -30,3 +32,7 @@ codegen/sdk-codegen/smithy-build.json
3032
.gradle
3133
*/out/
3234
*/*/out/
35+
36+
protocol_tests/*/coverage
37+
protocol_tests/*/dist
38+
protocol_tests/*/types

buildspec.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,17 @@ phases:
66
nodejs: 10
77
build:
88
commands:
9+
# Fake credentials for protocol tests to get past signing.
10+
- export AWS_ACCESS_KEY_ID=foo
11+
- export AWS_SECRET_ACCESS_KEY=bar
912
- echo Building...
1013
- yarn --frozen-lockfile
14+
# Run the actual tests.
1115
- echo Executing unit tests
1216
- yarn test:all
1317
- echo Executing functional test
1418
- yarn test:functional
1519
post_build:
1620
commands:
21+
# Handle code coverage.
1722
- ./node_modules/.bin/codecov -f coverage/*.json -t 26989a8c-a2e9-4e6f-844a-35a741240b60

codegen/protocol-test-codegen/smithy-build.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
},
1717
"license": "Apache-2.0"
1818
},
19-
"protocol": "aws.ec2"
19+
"protocol": "aws.ec2",
20+
"private": true
2021
}
2122
}
2223
},
@@ -35,7 +36,8 @@
3536
},
3637
"license": "Apache-2.0"
3738
},
38-
"protocol": "aws.json-1.1"
39+
"protocol": "aws.json-1.1",
40+
"private": true
3941
}
4042
}
4143
},
@@ -54,7 +56,8 @@
5456
},
5557
"license": "Apache-2.0"
5658
},
57-
"protocol": "aws.query"
59+
"protocol": "aws.query",
60+
"private": true
5861
}
5962
}
6063
},
@@ -73,7 +76,8 @@
7376
},
7477
"license": "Apache-2.0"
7578
},
76-
"protocol": "aws.rest-json-1.1"
79+
"protocol": "aws.rest-json-1.1",
80+
"private": true
7781
}
7882
}
7983
},
@@ -92,7 +96,8 @@
9296
},
9397
"license": "Apache-2.0"
9498
},
95-
"protocol": "aws.rest-xml"
99+
"protocol": "aws.rest-xml",
100+
"private": true
96101
}
97102
}
98103
}

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const base = require("./jest.config.base.js");
22

33
module.exports = {
44
...base,
5-
projects: ["<rootDir>/packages/*/jest.config.js"],
5+
projects: ["<rootDir>/protocol_tests/*/jest.config.js", "<rootDir>/packages/*/jest.config.js"],
66
testPathIgnorePatterns: ["/node_modules/", "<rootDir>/clients/client-.*"],
77
coveragePathIgnorePatterns: [
88
"/node_modules/",

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@
1111
"clear-build-cache": "rimraf ./packages/*/build/* ./clients/*/*/build/*",
1212
"clear-build-info": "rimraf ./packages/*/*.tsbuildinfo ./clients/*/*/*.tsbuildinfo",
1313
"build:crypto-dependencies": "lerna run --scope '@aws-sdk/types' --scope '@aws-sdk/util-utf8-browser' --scope '@aws-sdk/util-locate-window' --scope '@aws-sdk/hash-node' --include-dependencies pretest",
14+
"build:protocols": "yarn build:crypto-dependencies && lerna run --scope '@aws-sdk/protocol-tests-*' --include-dependencies pretest",
1415
"build:smithy-client": "yarn build:crypto-dependencies && lerna run --scope '@aws-sdk/client-rds-data' --include-dependencies pretest",
1516
"build:all": "yarn build:crypto-dependencies && lerna run pretest --include-dependencies --include-dependents",
1617
"pretest:all": "yarn build:all",
1718
"test:all": "jest --coverage --passWithNoTests && lerna run test --scope @aws-sdk/stream-collector-browser --scope @aws-sdk/hash-blob-browser",
1819
"test:functional": "jest --config tests/functional/jest.config.js --passWithNoTests",
19-
"test:integration": "cucumber-js"
20+
"test:integration": "cucumber-js",
21+
"test:protocols": "yarn build:protocols && lerna run test --scope '@aws-sdk/protocol-tests-*'"
2022
},
2123
"repository": {
2224
"type": "git",
@@ -53,7 +55,8 @@
5355
"workspaces": {
5456
"packages": [
5557
"packages/*",
56-
"clients/*"
58+
"clients/*",
59+
"protocol_tests/*"
5760
],
5861
"nohoist": [
5962
"**/karma*",

0 commit comments

Comments
 (0)