You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Add integration testing framework for PowerShell Lambda runtime
Merge pull request awslabs#46 from austoonz/feature/adding-integration-tests
Add integration testing infrastructure to validate PowerShell Lambda runtime functionality across handler types.
- Integration test suite for Script, Function, and Module handler types
- Helper module with validation functions and schema-based context validation
- AWS infrastructure template for test environment deployment
- Test handler implementations for each PowerShell handler pattern
This establishes testing infrastructure to validate runtime functionality and support regression testing.
Copy file name to clipboardExpand all lines: README.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,12 @@ This runtime uses Lambda's [custom runtime](https://docs.aws.amazon.com/lambda/l
28
28
29
29
### Testing
30
30
31
-
The runtime includes comprehensive unit tests. See [powershell-runtime/tests/README.md](powershell-runtime/tests/README.md) for testing documentation and commands.
31
+
The runtime includes unit tests and integration tests:
32
+
33
+
***Unit Tests**: Automated tests covering runtime functions and build processes
34
+
***Integration Tests**: Manual tests with real AWS Lambda functions for end-to-end validation
35
+
36
+
See [powershell-runtime/tests/README.md](powershell-runtime/tests/README.md) for testing documentation and commands.
Copy file name to clipboardExpand all lines: powershell-runtime/readme.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
-
# PowerShell-runtime
1
+
# PowerShell Runtime
2
2
3
3
Contains the PowerShell custom runtime based on `provided.al2023` with deployment methods.
4
4
5
5
Deploy the example [demo-runtime-layer-function](../examples/demo-runtime-layer-function/) to explore how the runtime and PowerShell function work.
6
6
7
-
## Deploying the PowerShell custom runtime
7
+
## Deploying the PowerShell Custom Runtime
8
8
9
-
The recommended deployment method is AWS SAM, though other infrastructure-as-code tools are also supported.
9
+
AWS SAM is the deployment method, though other infrastructure-as-code tools are also supported.
10
10
11
11
## AWS SAM
12
12
@@ -58,7 +58,7 @@ Enter a **Stack Name** such as `powershell-runtime` and accept the remaining ini
58
58
59
59
## Development and Testing
60
60
61
-
See [tests/README.md](tests/README.md) for comprehensive testing documentation and commands.
61
+
See [tests/README.md](tests/README.md) for testing documentation and commands.
62
62
63
63
## Powershell runtime information
64
64
@@ -121,7 +121,7 @@ The PowerShell runtime imports the specified `<module_name>`. This allows you to
121
121
122
122
### PowerShell module support
123
123
124
-
You can include additional PowerShell modules either via a Lambda Layer, or within your function code package, or container image. Using Lambda layers provides a convenient way to package and share modules that you can use with your Lambda functions. Layers reduce the size of uploaded deployment archives and make it faster to deploy your code.
124
+
You can include PowerShell modules via a Lambda Layer, within your function code package, or container image. Using Lambda layers provides a way to package and share modules that you can use with your Lambda functions. Layers reduce the size of uploaded deployment archives and make it faster to deploy your code.
125
125
126
126
The `PSModulePath` environment variable contains a list of folder locations that are searched to find user-supplied modules. This is configured during the runtime initialization. Folders are specified in the following order:
Write-Host"Successfully set $outputCount stack output environment variables for integration tests"-ForegroundColor Green
326
+
Write-Host"Environment variable PWSH_TEST_INFRASTRUCTURE_DEPLOYED has been set to TRUE"-ForegroundColor Green
327
+
Write-Host"Configuration environment variables (PWSH_TEST_STACK_NAME, PWSH_TEST_AWS_REGION$(if ($ProfileName) { ', PWSH_TEST_PROFILE_NAME' })) have been set"-ForegroundColor Green
328
+
}
329
+
330
+
functionClear-IntegrationTestEnvironment {
331
+
[CmdletBinding()]
332
+
param()
333
+
334
+
Write-Host"Cleaning up integration test environment variables..."-ForegroundColor Yellow
335
+
336
+
# Get all environment variables that start with PWSH_TEST_
Write-Error"Failed to initialize integration test environment: $_"
520
+
throw"Integration test environment setup failed. Please ensure the CloudFormation stack '$StackName' exists in region '$Region' and you have appropriate permissions."
0 commit comments