Skip to content

Commit

Permalink
run integration tests in GitHub CI (#2828)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucix-aws authored Oct 9, 2024
1 parent 0cbb5aa commit 5dc4057
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .changelog/7d52e0ac9c1740708a426c1f8a1593ff.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"id": "7d52e0ac-9c17-4070-8a42-6c1f8a1593ff",
"type": "bugfix",
"collapse": true,
"description": "Fixup some integration tests.",
"modules": [
"feature/s3/manager",
"service/internal/integrationtest"
]
}
43 changes: 43 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Integration Tests

# these are expensive, limit how often they're running
#
# functionally, all we need to do is vet the code going into main
on:
pull_request:
branches:
- main

permissions:
id-token: write

# again, expensive, only one per PR can run and they self-cancel
concurrency:
group: ci-codebuild-${{ github.ref }}
cancel-in-progress: true

jobs:
integration-tests:
name: Integration Tests
runs-on: ubuntu-latest
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
aws-region: us-west-2
- name: Run tests
id: integration-tests
uses: aws-actions/aws-codebuild-run-build@v1
with:
project-name: aws-sdk-go-v2-integrationtests
- name: Cancel tests
if: ${{ cancelled() }}
env:
BUILD_ID: ${{ steps.integration-tests.outputs.aws-build-id }}
run: |
if [ ! -z "$BUILD_ID" ]; then
echo "aws codebuild stop-build --id $BUILD_ID"
aws codebuild stop-build --id $BUILD_ID
fi
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ ci-lint-install:
#######################
.PHONY: integration integ-modules-% cleanup-integ-buckets

integration: integ-modules-service
integration: integ-modules-service integ-modules-feature

integ-modules-%:
@# integration command that uses the pattern to define the root path that
Expand Down
2 changes: 1 addition & 1 deletion feature/s3/manager/integ_upload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ func (b *invalidateHash) RegisterMiddleware(stack *middleware.Stack) error {
func (b *invalidateHash) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if input, ok := in.Parameters.(*s3.UploadPartInput); ok && input.PartNumber == aws.Int32(2) {
if input, ok := in.Parameters.(*s3.UploadPartInput); ok && aws.ToInt32(input.PartNumber) == 2 {
ctx = v4.SetPayloadHash(ctx, "000")
}

Expand Down
2 changes: 2 additions & 0 deletions service/internal/integrationtest/health/smoke_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import (
)

func TestInteg_00_DescribeEntityAggregates(t *testing.T) {
t.Skip() // requires enterprise support, V1543069783

ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second)
defer cancelFn()

Expand Down
4 changes: 4 additions & 0 deletions service/internal/integrationtest/support/smoke_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import (
)

func TestInteg_00_DescribeServices(t *testing.T) {
t.Skip() // requires enterprise support, V1543069783

ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second)
defer cancelFn()

Expand All @@ -34,6 +36,8 @@ func TestInteg_00_DescribeServices(t *testing.T) {
}

func TestInteg_01_CreateCase(t *testing.T) {
t.Skip() // requires enterprise support, V1543069783

ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second)
defer cancelFn()

Expand Down

0 comments on commit 5dc4057

Please sign in to comment.