Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added concurrent testing and release updates #526

Merged
merged 24 commits into from
Aug 2, 2022
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
2cbaafe
Added concurrent testing and release updates
okankoAMZ Jul 27, 2022
9676dd4
added the git date env variable
okankoAMZ Jul 27, 2022
a8f40cd
applied pr comments
okankoAMZ Jul 28, 2022
74bca13
Applied PR changes
okankoAMZ Jul 28, 2022
b068ea6
bug fixes
okankoAMZ Jul 28, 2022
5217407
fixed error due skipNow
okankoAMZ Jul 29, 2022
2b87a82
updated the release tag
okankoAMZ Jul 29, 2022
7eb43be
working release test
okankoAMZ Jul 29, 2022
7eba705
Applied PR changes #3
okankoAMZ Aug 1, 2022
bd099e0
Merge branch 'aws:master' into config-and-release
okankoAMZ Aug 1, 2022
a7a7cae
go mod tidy
okankoAMZ Aug 1, 2022
ddafc1e
Merge branch 'aws:master' into config-and-release
okankoAMZ Aug 2, 2022
77388c7
tried resetting go mod
okankoAMZ Aug 2, 2022
1ba4ffe
Merge branch 'config-and-release' of https://github.com/okankoAMZ/ama…
okankoAMZ Aug 2, 2022
27cf5b2
small fix with expression update
okankoAMZ Aug 2, 2022
40f6ac8
changed and to coma
okankoAMZ Aug 2, 2022
975c06c
changed expression
okankoAMZ Aug 2, 2022
057bcd8
Merge branch 'aws:master' into config-and-release
okankoAMZ Aug 2, 2022
b515357
go mod tidy
okankoAMZ Aug 2, 2022
b4fdddf
Merge branch 'config-and-release' of https://github.com/okankoAMZ/ama…
okankoAMZ Aug 2, 2022
9a00292
Added concurrent testing and release updates
okankoAMZ Jul 27, 2022
5bdfdce
Update Deprecated CodeQL (#531)
sethAmazon Aug 2, 2022
16813cb
Fix Code Scan Bug https://github.com/aws/amazon-cloudwatch-agent/secu…
sethAmazon Aug 2, 2022
7502aa1
Merge branch 'config-and-release' of https://github.com/okankoAMZ/ama…
okankoAMZ Aug 2, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 26 additions & 20 deletions .github/workflows/integrationTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ on:
branches:
- master


workflow_dispatch:

concurrency:
Expand Down Expand Up @@ -140,12 +141,12 @@ jobs:
- name: Upload to s3
if: steps.cached_binaries.outputs.cache-hit != 'true'
run: aws s3 cp build/bin s3://${S3_INTEGRATION_BUCKET}/integration-test/binary/${{ github.sha }} --recursive

GenerateTestMatrix:
name: 'GenerateTestMatrix'
runs-on: ubuntu-latest
outputs:
ec2_linux_matrix: ${{ steps.set-matrix.outputs.ec2_linux_matrix }}
ec2_performance_matrix: ${{steps.set-matrix.outputs.ec2_performance_matrix}}
ec2_windows_matrix: ${{ steps.set-matrix.outputs.ec2_windows_matrix }}
ecs_fargate_matrix: ${{ steps.set-matrix.outputs.ecs_fargate_matrix }}
steps:
Expand All @@ -161,12 +162,14 @@ jobs:
run: |
go run --tags=generator integration/generator/test_case_generator.go
echo "::set-output name=ec2_linux_matrix::$(echo $(cat integration/generator/resources/ec2_linux_complete_test_matrix.json))"
echo "::set-output name=ec2_performance_matrix::$(echo $(cat integration/generator/resources/ec2_performance_complete_test_matrix.json))"
echo "::set-output name=ec2_windows_matrix::$(echo $(cat integration/generator/resources/ec2_windows_complete_test_matrix.json))"
echo "::set-output name=ecs_fargate_matrix::$(echo $(cat integration/generator/resources/ecs_fargate_complete_test_matrix.json))"

- name: Echo test plan matrix
run: |
echo ${{ steps.set-matrix.outputs.ec2_linux_matrix }}
echo ${{ steps.set-matrix.outputs.ec2_performance_matrix}}
echo ${{ steps.set-matrix.outputs.ec2_windows_matrix }}
echo ${{ steps.set-matrix.outputs.ecs_fargate_matrix }}

Expand Down Expand Up @@ -619,6 +622,10 @@ jobs:
name: "PerformanceTrackingTest"
needs: [MakeBinary, StartLocalStack, GenerateTestMatrix]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arrays: ${{ fromJson(needs.GenerateTestMatrix.outputs.ec2_performance_matrix) }}
steps:
- uses: actions/checkout@v2

Expand All @@ -638,52 +645,51 @@ jobs:

- name: Echo Test Info
run: echo run performance-tracking

- name: Verify Terraform version
run: terraform --version

- name: Get SHA
id: sha
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Get git date
id: sha_date
run: echo "::set-output name=sha_date::$(git show -s --format=%ct ${{ steps.sha.outputs.sha_short }} )"

- name: Check env
run: echo "SHA ${GITHUB_SHA} | Date ${{ steps.sha_date.outputs.sha_date }}"

run: echo "SHA ${{ steps.sha.outputs.sha_short }} | Date ${{ steps.sha_date.outputs.sha_date }} "
- name: Verify Terraform version
run: terraform --version
- name: Terraform apply
if: steps.performance-tracking.outputs.cache-hit != 'true'
uses: nick-invision/retry@v2
with:
max_attempts: 1
timeout_minutes: 50
timeout_minutes: 30
retry_wait_seconds: 5
command: |
cd integration/terraform/ec2/linux
terraform init
if terraform apply --auto-approve \
-var="ssh_key=${PRIVATE_KEY}" -var="github_repo=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" \
-var="github_sha=${GITHUB_SHA}" -var="install_agent=rpm -U ./amazon-cloudwatch-agent.rpm" \
-var="user=ec2-user" \
-var="ami=cloudwatch-agent-integration-test-al2*" \
-var="ca_cert_path=/etc/ssl/certs/ca-bundle.crt" \
-var="arc=amd64" \
-var="binary_name=amazon-cloudwatch-agent.rpm" \
-var="github_sha=${GITHUB_SHA}" -var="install_agent=${{ matrix.arrays.installAgentCommand }}" \
-var="user=${{ matrix.arrays.username }}" \
-var="ami=${{ matrix.arrays.ami }}" \
-var="ca_cert_path=${{ matrix.arrays.caCertPath }}" \
-var="arc=${{ matrix.arrays.arc }}" \
-var="binary_name=${{ matrix.arrays.binaryName }}" \
-var="local_stack_host_name=${{ needs.StartLocalStack.outputs.local_stack_host_name }}" \
-var="s3_bucket=${S3_INTEGRATION_BUCKET}" \
-var="key_name=${KEY_NAME}" \
-var="test_name=cw-integ-test-al2" \
-var="github_sha_date=${{ steps.sha_date.outputs.sha_date }}" \
-var="test_dir=./integration/test/performancetest" ; then terraform destroy -auto-approve

-var="test_name=cw-integ-test-${{ matrix.arrays.os }}" \
-var="performance_number_of_logs=${{ matrix.arrays.performance_number_of_logs}}"\
-var="test_dir=${{ matrix.arrays.test_dir }}" ; then terraform destroy -auto-approve
else
terraform destroy -auto-approve && exit 1
fi

#This is here just in case workflow cancel
- name: Terraform destroy
if: ${{ cancelled() && steps.performance-tracking.outputs.cache-hit != 'true' }}
if: ${{ cancelled() && steps.ec2-linux-integration-test.outputs.cache-hit != 'true' }}
okankoAMZ marked this conversation as resolved.
Show resolved Hide resolved
uses: nick-invision/retry@v2
with:
max_attempts: 3
timeout_minutes: 8
retry_wait_seconds: 5
command: cd integration/terraform/ec2/linux && terraform destroy --auto-approve
command: cd integration/terraform/ec2/linux && terraform destroy --auto-approve
52 changes: 52 additions & 0 deletions .github/workflows/releaseTest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
okankoAMZ marked this conversation as resolved.
Show resolved Hide resolved
# SPDX-License-Identifier: MIT

name: Release Update
env:
PRIVATE_KEY: ${{ secrets.AWS_PRIVATE_KEY }}
TERRAFORM_AWS_ACCESS_KEY_ID: ${{ secrets.TERRAFORM_AWS_ACCESS_KEY_ID }}
TERRAFORM_AWS_SECRET_ACCESS_KEY: ${{ secrets.TERRAFORM_AWS_SECRET_ACCESS_KEY }}
S3_INTEGRATION_BUCKET: ${{ secrets.S3_INTEGRATION_BUCKET }}
KEY_NAME: ${{ secrets.KEY_NAME }}
VPC_SECURITY_GROUPS_IDS: ${{ secrets.VPC_SECURITY_GROUPS_IDS }}
IAM_ROLE: ${{ secrets.IAM_ROLE }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
PASSPHRASE: ${{ secrets.PASSPHRASE }}
GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }}
GPG_TTY: $(tty)

on:
release:
types: [created]

workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

jobs:
UpdatePerformanceMetrics:
name: "UpdatePerformanceMetrics"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ~1.18.3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.TERRAFORM_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.TERRAFORM_AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2

- name: Update isRelease for this release
run: |
cd integration/test/performancetest
export IS_RELEASE=true
export SHA=$GITHUB_SHA
go test -run TestUpdateCommit -p 1 -v --tags=integration

38 changes: 9 additions & 29 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ require (
github.com/gobwas/glob v0.2.3
github.com/google/cadvisor v0.44.0
github.com/google/go-cmp v0.5.8
github.com/google/uuid v1.3.0
okankoAMZ marked this conversation as resolved.
Show resolved Hide resolved
github.com/hashicorp/golang-lru v0.5.4
github.com/influxdata/telegraf v0.0.0-00010101000000-000000000000
github.com/influxdata/toml v0.0.0-20190415235208-270119a8ce65
Expand Down Expand Up @@ -102,7 +103,6 @@ require (
cloud.google.com/go/compute v1.6.0 // indirect
collectd.org v0.4.0 // indirect
github.com/Azure/azure-sdk-for-go v63.0.0+incompatible // indirect
github.com/Azure/go-amqp v0.17.4 // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest v0.11.25 // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.18 // indirect
Expand All @@ -111,17 +111,14 @@ require (
github.com/Azure/go-autorest/autorest/validation v0.3.1 // indirect
github.com/Azure/go-autorest/logger v0.2.1 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/Azure/go-ntlmssp v0.0.0-20211209120228-48547f28849e // indirect
github.com/Microsoft/go-winio v0.5.1 // indirect
github.com/StackExchange/wmi v1.2.1 // indirect
github.com/StackExchange/wmi v0.0.0-20210224194228-fe8f1750fd46 // indirect
github.com/alecthomas/participle v0.4.1 // indirect
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect
github.com/antchfx/jsonquery v1.1.5 // indirect
github.com/antchfx/xmlquery v1.3.9 // indirect
github.com/antchfx/xpath v1.2.0 // indirect
github.com/apache/thrift v0.16.0 // indirect
github.com/armon/go-metrics v0.3.10 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.1 // indirect
github.com/armon/go-metrics v0.3.3 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.11.2 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.12 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.6 // indirect
Expand All @@ -130,7 +127,6 @@ require (
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.2 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.7.6 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.3 // indirect
github.com/aws/aws-sdk-go-v2/service/s3 v1.26.5 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.11.3 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.16.3 // indirect
github.com/benbjohnson/clock v1.3.0 // indirect
Expand All @@ -140,7 +136,7 @@ require (
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/checkpoint-restore/go-criu/v5 v5.3.0 // indirect
github.com/cilium/ebpf v0.7.0 // indirect
github.com/cncf/xds/go v0.0.0-20211130200136-a8f946100490 // indirect
github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1 // indirect
github.com/containerd/console v1.0.3 // indirect
github.com/containerd/containerd v1.6.1 // indirect
github.com/containerd/ttrpc v1.1.0 // indirect
Expand All @@ -159,9 +155,7 @@ require (
github.com/envoyproxy/protoc-gen-validate v0.6.7 // indirect
github.com/euank/go-kmsg-parser v2.0.0+incompatible // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/frankban/quicktest v1.14.2 // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/go-asn1-ber/asn1-ber v1.5.4 // indirect
github.com/go-kit/log v0.2.0 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/go-logr/logr v1.2.3 // indirect
Expand All @@ -171,36 +165,32 @@ require (
github.com/godbus/dbus/v5 v5.0.6 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.2.0 // indirect
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/go-querystring v1.0.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/gax-go/v2 v2.3.0 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/gophercloud/gophercloud v0.24.0 // indirect
github.com/gosnmp/gosnmp v1.34.0 // indirect
github.com/grafana/regexp v0.0.0-20220304095617-2e8d9baf4ac2 // indirect
github.com/hashicorp/consul/api v1.12.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-hclog v1.2.0 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-cleanhttp v0.5.1 // indirect
github.com/hashicorp/go-hclog v0.16.2 // indirect
github.com/hashicorp/go-immutable-radix v1.2.0 // indirect
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
github.com/hashicorp/serf v0.9.6 // indirect
github.com/hetznercloud/hcloud-go v1.33.1 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/influxdata/line-protocol/v2 v2.2.1 // indirect
github.com/jaegertracing/jaeger v1.33.0 // indirect
github.com/jhump/protoreflect v1.8.3-0.20210616212123-6cc1efa697ca // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jpillora/backoff v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/karrick/godirwalk v1.16.1 // indirect
github.com/kolo/xmlrpc v0.0.0-20201022064351-38db28db192b // indirect
github.com/kr/text v0.2.0 // indirect
github.com/leodido/ragel-machinery v0.0.0-20190525184631-5f46317e436b // indirect
github.com/linode/linodego v1.4.1 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
Expand All @@ -223,20 +213,17 @@ require (
github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417 // indirect
github.com/opencontainers/selinux v1.10.0 // indirect
github.com/philhofer/fwd v1.1.1 // indirect
github.com/pierrec/lz4/v4 v4.1.14 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/pquerna/ffjson v0.0.0-20190930134022-aa0246cd15f7 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common/sigv4 v0.1.0 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/rogpeppe/go-internal v1.6.2 // indirect
github.com/rogpeppe/go-internal v1.6.1 // indirect
github.com/safchain/ethtool v0.0.0-20210803160452-9aa261dae9b1 // indirect
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9 // indirect
github.com/seccomp/libseccomp-golang v0.9.2-0.20210429002308-3879420cc921 // indirect
github.com/shirou/gopsutil v3.21.5+incompatible // indirect
github.com/signalfx/com_signalfx_metrics_protobuf v0.0.3 // indirect
github.com/signalfx/sapm-proto v0.9.0 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/sleepinggenius2/gosmi v0.4.4 // indirect
github.com/spf13/pflag v1.0.5 // indirect
Expand All @@ -252,17 +239,13 @@ require (
github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f // indirect
github.com/vjeantet/grok v1.0.1 // indirect
github.com/wavefronthq/wavefront-sdk-go v0.9.10 // indirect
github.com/xdg-go/scram v1.1.1 // indirect
github.com/xdg-go/stringprep v1.0.3 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/yuin/gopher-lua v0.0.0-20220413183635-c841877397d8 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect
go.opencensus.io v0.23.0 // indirect
go.opentelemetry.io/collector/model v0.48.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/goleak v1.1.12 // indirect
go.uber.org/multierr v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
okankoAMZ marked this conversation as resolved.
Show resolved Hide resolved
golang.org/x/crypto v0.0.0-20220214200702-86341886e292 // indirect
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 // indirect
Expand All @@ -276,12 +259,9 @@ require (
google.golang.org/grpc v1.46.0 // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.66.4 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect
k8s.io/utils v0.0.0-20211116205334-6203023598ed // indirect
modernc.org/ccgo/v3 v3.16.2 // indirect
modernc.org/libc v1.15.0 // indirect
sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
sigs.k8s.io/yaml v1.2.0 // indirect
Expand Down
Loading