-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Onboard the repo to the testing infra
- Loading branch information
Showing
11 changed files
with
117 additions
and
47 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: AWS CI | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- master | ||
- dev | ||
- 'feature/**' | ||
|
||
permissions: | ||
id-token: write | ||
|
||
jobs: | ||
run-ci: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 #v4 | ||
with: | ||
role-to-assume: ${{ secrets.CI_MAIN_TESTING_ACCOUNT_ROLE_ARN }} | ||
role-duration-seconds: 7200 | ||
aws-region: us-west-2 | ||
- name: Invoke Load Balancer Lambda | ||
id: lambda | ||
shell: pwsh | ||
run: | | ||
aws lambda invoke response.json --function-name "${{ secrets.CI_TESTING_LOAD_BALANCER_LAMBDA_NAME }}" --cli-binary-format raw-in-base64-out --payload '{"Roles": "${{ secrets.CI_TEST_RUNNER_ACCOUNT_ROLES }}", "ProjectName": "${{ secrets.CI_TESTING_CODE_BUILD_PROJECT_NAME }}", "Branch": "${{ github.sha }}"}' | ||
$roleArn=$(cat ./response.json) | ||
"roleArn=$($roleArn -replace '"', '')" >> $env:GITHUB_OUTPUT | ||
- name: Configure Test Runner Credentials | ||
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 #v4 | ||
with: | ||
role-to-assume: ${{ steps.lambda.outputs.roleArn }} | ||
role-duration-seconds: 7200 | ||
aws-region: us-west-2 | ||
- name: Run Tests on AWS | ||
id: codebuild | ||
uses: aws-actions/aws-codebuild-run-build@v1 | ||
with: | ||
project-name: ${{ secrets.CI_TESTING_CODE_BUILD_PROJECT_NAME }} | ||
- name: CodeBuild Link | ||
shell: pwsh | ||
run: | | ||
$buildId = "${{ steps.codebuild.outputs.aws-build-id }}" | ||
echo $buildId |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
version: 0.2 | ||
|
||
phases: | ||
install: | ||
runtime-versions: | ||
dotnet: 8.x | ||
build: | ||
commands: | ||
- dotnet test test/Amazon.Extensions.CognitoAuthentication.UnitTests/Amazon.Extensions.CognitoAuthentication.UnitTests.csproj -c Release --logger trx --results-directory ./testresults | ||
- dotnet test test/Amazon.Extensions.CognitoAuthentication.IntegrationTests/Amazon.Extensions.CognitoAuthentication.IntegrationTests.csproj -c Release --logger trx --results-directory ./testresults | ||
reports: | ||
aws-ssm-data-protection-provider-for-aspnet-tests: | ||
file-format: VisualStudioTrx | ||
files: | ||
- '**/*' | ||
base-directory: './testresults' |
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
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 |
---|---|---|
|
@@ -61,14 +61,14 @@ public async Task TestSignUpProcess() | |
{ CognitoConstants.UserAttrEmail, "[email protected]"} | ||
}; | ||
|
||
await pool.SignUpAsync(userID, password, userAttributes, validationData).ConfigureAwait(false); | ||
await pool.SignUpAsync(userID, password, userAttributes, validationData); | ||
|
||
ListUsersRequest listUsersRequest = new ListUsersRequest() | ||
{ | ||
Limit = 2, | ||
UserPoolId = pool.PoolID | ||
}; | ||
ListUsersResponse listUsersResponse = await provider.ListUsersAsync(listUsersRequest).ConfigureAwait(false); | ||
ListUsersResponse listUsersResponse = await provider.ListUsersAsync(listUsersRequest); | ||
bool containsUser55 = false; | ||
|
||
foreach (UserType user in listUsersResponse.Users) | ||
|
@@ -84,9 +84,9 @@ public async Task TestSignUpProcess() | |
|
||
// Tests that ConfirmSignUp reaches the proper failure point with incorrect confirmation code | ||
[Fact] | ||
public void TestConfirmSignUpFail() | ||
public async Task TestConfirmSignUpFail() | ||
{ | ||
Assert.ThrowsAsync<CodeMismatchException>(() => user.ConfirmSignUpAsync("fakeConfirmationCode", false)); | ||
await Assert.ThrowsAsync<CodeMismatchException>(() => user.ConfirmSignUpAsync("fakeConfirmationCode", false)); | ||
} | ||
} | ||
} |
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
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.