-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AT-10925: refactor integration tests
- Loading branch information
Showing
17 changed files
with
690 additions
and
746 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,86 +1,88 @@ | ||
export interface SubnetItem { | ||
tagKey: string; | ||
tagValues: string[]; | ||
tagKey: string; | ||
tagValues: string[]; | ||
} | ||
|
||
export interface SecurityGroupItem { | ||
tagKey?: string; | ||
tagValues?: string[]; | ||
names?: string[]; | ||
tagKey?: string; | ||
tagValues?: string[]; | ||
names?: string[]; | ||
} | ||
|
||
export interface VPCDiscovery { | ||
vpcName: string; | ||
subnets?: SubnetItem[]; | ||
securityGroups?: SecurityGroupItem[]; | ||
// for supporting back compatibility | ||
subnetNames?: string[]; | ||
securityGroupNames?: string[]; | ||
vpcName: string; | ||
subnets?: SubnetItem[]; | ||
securityGroups?: SecurityGroupItem[]; | ||
// for supporting back compatibility | ||
subnetNames?: string[]; | ||
securityGroupNames?: string[]; | ||
} | ||
|
||
export interface VPC { | ||
subnetIds?: string[]; | ||
securityGroupIds?: string[]; | ||
subnetIds?: string[]; | ||
securityGroupIds?: string[]; | ||
} | ||
|
||
export interface ServerlessService { | ||
service: string | ||
provider: { | ||
stage: string, | ||
region?: string | ||
vpc: {}, | ||
}, | ||
functions: { | ||
name: { | ||
vpc: { | ||
subnetIds: {} | undefined, | ||
securityGroupIds: {} | undefined, | ||
}, | ||
vpcDiscovery: VPCDiscovery | boolean | undefined | ||
} | ||
}, | ||
custom: { | ||
vpcDiscovery: VPCDiscovery | undefined | ||
} | ||
} | ||
|
||
export interface ServerlessInstance { | ||
service: { | ||
service: string | ||
provider: { | ||
stage: string, | ||
region?: string | ||
vpc: {}, | ||
}, | ||
functions: { | ||
name: { | ||
vpc: { | ||
subnetIds: {} | undefined, | ||
securityGroupIds: {} | undefined, | ||
}, | ||
vpcDiscovery: VPCDiscovery | boolean | undefined | ||
} | ||
}, | ||
custom: { | ||
vpcDiscovery: VPCDiscovery | undefined | ||
}, | ||
}; | ||
providers: { | ||
aws: { | ||
getCredentials(), | ||
getRegion(), | ||
}, | ||
}; | ||
configSchemaHandler: { | ||
defineCustomProperties(props: any), | ||
defineFunctionProperties(provider: string, props: any), | ||
}; | ||
cli: { | ||
log(str: string, entity?: string), | ||
consoleLog(str: any), | ||
}; | ||
service: ServerlessService; | ||
providers: { | ||
aws: { | ||
getCredentials (), | ||
getRegion (), | ||
}, | ||
}; | ||
configSchemaHandler: { | ||
defineCustomProperties (props: any), | ||
defineFunctionProperties (provider: string, props: any), | ||
}; | ||
cli: { | ||
log (str: string, entity?: string), | ||
consoleLog (str: any), | ||
}; | ||
} | ||
|
||
export interface ServerlessOptions { | ||
stage: string; | ||
region?: string; | ||
stage: string; | ||
region?: string; | ||
} | ||
|
||
interface ServerlessProgress { | ||
update(message: string): void | ||
update (message: string): void | ||
|
||
remove(): void | ||
remove (): void | ||
} | ||
|
||
export interface ServerlessProgressFactory { | ||
get(name: string): ServerlessProgress; | ||
get (name: string): ServerlessProgress; | ||
} | ||
|
||
export interface ServerlessUtils { | ||
writeText: (message: string) => void, | ||
log: ((message: string) => void) & { | ||
error(message: string): void | ||
verbose(message: string): void | ||
warning(message: string): void | ||
} | ||
progress: ServerlessProgressFactory | ||
writeText: (message: string) => void, | ||
log: ((message: string) => void) & { | ||
error (message: string): void | ||
verbose (message: string): void | ||
warning (message: string): void | ||
} | ||
progress: ServerlessProgressFactory | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,23 @@ | ||
import randomstring from "randomstring"; | ||
|
||
const TEST_VPC_NAME = process.env.TEST_VPC_NAME; | ||
|
||
if (!TEST_VPC_NAME) { | ||
throw new Error("TEST_VPC_NAME environment variable not set"); | ||
} | ||
|
||
function getRandomString (): string { | ||
return randomstring.generate({ | ||
capitalization: "lowercase", | ||
charset: "alphanumeric", | ||
length: 5 | ||
}); | ||
} | ||
const RANDOM_STRING = randomstring.generate({ | ||
capitalization: "lowercase", | ||
charset: "alphanumeric", | ||
length: 5 | ||
}); | ||
|
||
// this is important to set as we are using this var in the serverless yml config | ||
process.env.RANDOM_STRING = RANDOM_STRING; | ||
|
||
const TEMP_DIR = `~/tmp/vpc-discovery-test-${RANDOM_STRING}`; | ||
|
||
export { | ||
getRandomString, | ||
TEST_VPC_NAME | ||
TEST_VPC_NAME, | ||
RANDOM_STRING, | ||
TEMP_DIR | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.