Skip to content

Commit

Permalink
chore(packages): consolidate middleware integ tests (#4850)
Browse files Browse the repository at this point in the history
  • Loading branch information
srchase authored Jun 30, 2023
1 parent bd1bd61 commit 706c2ce
Show file tree
Hide file tree
Showing 19 changed files with 98 additions and 30 deletions.
3 changes: 1 addition & 2 deletions packages/middleware-apply-body-checksum/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"build:types": "tsc -p tsconfig.types.json",
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"test": "jest --coverage",
"test:integration": "jest --config jest.config.integ.js"
"test": "jest --coverage"
},
"main": "./dist-cjs/index.js",
"module": "./dist-es/index.js",
Expand Down
4 changes: 0 additions & 4 deletions packages/middleware-content-length/jest.config.integ.js

This file was deleted.

3 changes: 1 addition & 2 deletions packages/middleware-content-length/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"build:types": "tsc -p tsconfig.types.json",
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"test": "exit 0",
"test:integration": "jest --config jest.config.integ.js"
"test": "exit 0"
},
"main": "./dist-cjs/index.js",
"module": "./dist-es/index.js",
Expand Down
4 changes: 0 additions & 4 deletions packages/middleware-retry/jest.config.integ.js

This file was deleted.

3 changes: 1 addition & 2 deletions packages/middleware-retry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"extract:docs": "api-extractor run --local",
"test": "jest",
"test:integration": "jest -c jest.config.integ.js"
"test": "jest"
},
"main": "./dist-cjs/index.js",
"module": "./dist-es/index.js",
Expand Down
4 changes: 0 additions & 4 deletions packages/middleware-serde/jest.config.integ.js

This file was deleted.

3 changes: 1 addition & 2 deletions packages/middleware-serde/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"build:types": "tsc -p tsconfig.types.json",
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"test": "jest",
"test:integration": "jest -c jest.config.integ.js"
"test": "jest"
},
"main": "./dist-cjs/index.js",
"module": "./dist-es/index.js",
Expand Down
File renamed without changes.
10 changes: 10 additions & 0 deletions private/aws-client-retry-test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# @aws-sdk/aws-client-retry-test

This is not a runtime or published package.

This is a test spec.

The purpose of this package is to perform integration tests on the retry-middleware.

If tests in this package fail, the author should either fix their changes such that the API contract
is maintained, or appropriately announce and safely deprecate the interfaces affected by incoming changes.
7 changes: 5 additions & 2 deletions private/aws-client-retry-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
"module": "./dist-es/index.js",
"sideEffects": false,
"dependencies": {
"@aws-sdk/client-xray": "*",
"@aws-sdk/client-s3": "*",
"@aws-sdk/util-retry": "*",
"@smithy/protocol-http": "*",
"@smithy/types": "*",
"tslib": "^2.5.0"
},
"devDependencies": {
Expand Down Expand Up @@ -57,6 +60,6 @@
"repository": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-js-v3.git",
"directory": "private/aws-client-api-test"
"directory": "private/aws-client-retry-test"
}
}
4 changes: 4 additions & 0 deletions private/aws-middleware-test/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
preset: "ts-jest",
testMatch: ["**/*.integ.spec.ts"],
testMatch: ["**/*.spec.ts"],
};
67 changes: 67 additions & 0 deletions private/aws-middleware-test/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"name": "@aws-sdk/aws-middleware-test",
"description": "Integration test suite for AWS middleware",
"version": "3.0.0",
"scripts": {
"build": "exit 0",
"build:cjs": "exit 0",
"build:es": "exit 0",
"build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build",
"build:types": "tsc -p tsconfig.types.json",
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"test": "jest --coverage --passWithNoTests"
},
"main": "./dist-cjs/index.js",
"types": "./dist-types/index.d.ts",
"module": "./dist-es/index.js",
"sideEffects": false,
"dependencies": {
"@aws-sdk/client-accessanalyzer": "*",
"@aws-sdk/client-ec2": "*",
"@aws-sdk/client-lambda": "*",
"@aws-sdk/client-s3": "*",
"@aws-sdk/client-s3-control": "*",
"@aws-sdk/client-sagemaker": "*",
"@aws-sdk/client-sagemaker-runtime": "*",
"@aws-sdk/client-xray": "*",
"tslib": "^2.5.0"
},
"devDependencies": {
"@tsconfig/node14": "1.0.3",
"@types/node": "^12.7.5",
"concurrently": "7.0.0",
"downlevel-dts": "0.10.1",
"typedoc": "0.23.23",
"typescript": "~4.9.5"
},
"overrides": {
"typedoc": {
"typescript": "~4.9.5"
}
},
"engines": {
"node": ">=14.0.0"
},
"typesVersions": {
"<4.0": {
"dist-types/*": [
"dist-types/ts3.4/*"
]
}
},
"files": [
"dist-*/**"
],
"author": {
"name": "AWS SDK for JavaScript Team",
"url": "https://aws.amazon.com/javascript/"
},
"license": "Apache-2.0",
"private": true,
"repository": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-js-v3.git",
"directory": "private/aws-middleware-test"
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# @aws-sdk/aws-client-api-test
# @aws-sdk/aws-middleware-test

This is not a runtime or published package.

This is a test spec.

The purpose of this package is to perform integration tests on the retry-middleware.
The purpose of this package is to perform integration tests on the AWS middleware.

If tests in this package fail, the author should either fix their changes such that the API contract
is maintained, or appropriately announce and safely deprecate the interfaces affected by incoming changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { S3Control } from "@aws-sdk/client-s3-control";

import { requireRequestsFrom } from "../../../private/aws-util-test/src";
import { requireRequestsFrom } from "../../aws-util-test/src";

describe("middleware-apply-body-checksum", () => {
describe(S3Control.name, () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { AccessAnalyzer } from "@aws-sdk/client-accessanalyzer";
import { S3 } from "@aws-sdk/client-s3";
import { XRay } from "@aws-sdk/client-xray";

import { requireRequestsFrom } from "../../../private/aws-util-test/src";
import { requireRequestsFrom } from "../../aws-util-test/src";

describe("middleware-content-length", () => {
describe(AccessAnalyzer.name, () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { S3 } from "@aws-sdk/client-s3";
import { S3Control } from "@aws-sdk/client-s3-control";

import { requireRequestsFrom } from "../../../private/aws-util-test/src";
import { requireRequestsFrom } from "../../aws-util-test/src";

describe("middleware-endpoint", () => {
// these are token examples because most endpoint
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Lambda } from "@aws-sdk/client-lambda";

import { requireRequestsFrom } from "../../../private/aws-util-test/src";
import { requireRequestsFrom } from "../../aws-util-test/src";

describe("middleware-retry", () => {
describe(Lambda.name, () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { S3 } from "@aws-sdk/client-s3";
import { SageMaker } from "@aws-sdk/client-sagemaker";
import { SageMakerRuntime } from "@aws-sdk/client-sagemaker-runtime";

import { requireRequestsFrom } from "../../../private/aws-util-test/src";
import { requireRequestsFrom } from "../../aws-util-test/src";

describe("middleware-serde", () => {
describe(S3.name, () => {
Expand Down

0 comments on commit 706c2ce

Please sign in to comment.