From 20d4827470e45ea8879300a246538a3eb99ca3ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Madrigal=20=F0=9F=90=A7?= <599908+Madrigal@users.noreply.github.com> Date: Mon, 11 Nov 2024 15:34:53 -0500 Subject: [PATCH] [experimental] test results with a go.work file --- .github/workflows/go.yml | 6 +- Makefile | 22 ++ go.work | 435 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 460 insertions(+), 3 deletions(-) create mode 100644 go.work diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index be4fbba0a12..c277b5c1fd6 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -39,7 +39,7 @@ jobs: run: go install golang.org/x/lint/golint@latest - name: Test - run: make ci-test-no-generate -j 4 + run: make experimental-module x86-tests: name: Unix x86 SDK tests @@ -67,7 +67,7 @@ jobs: run: go install golang.org/x/lint/golint@latest - name: Test - run: make unit -j 4 + run: make experimental-module-no-race windows-tests: name: Windows SDK Tests @@ -93,4 +93,4 @@ jobs: run: ./ci-find-smithy-go.sh - name: Test - run: make vet build unit-test -j 4 + run: make experimental-module-no-race diff --git a/Makefile b/Makefile index 344f222ad0f..cd05ebbf8b0 100644 --- a/Makefile +++ b/Makefile @@ -267,6 +267,24 @@ unit-race-modules-%: "go test ${BUILD_TAGS} ${RUN_NONE} ./..." \ "go test -timeout=2m ${UNIT_TEST_TAGS} -race -cpu=1 ./..." +# EXPERIMENT will explore more if the results are good +# Basically instead of invoking "go test" n times per module (we have around 400 of them) +# call "go test" will all modules as arguments. This however is not as straightforward since +# this is a monorepo, so we have multiple modules that are not visible from root. +# Doing this needs a `go.work` file that there's a hot debate on whether it should be included into VCS or not +# So, before exploring this, ensure that the benefits are there +experimental-module: + go list -f '{{.Dir}}/...' -m | xargs go vet ${BUILD_TAGS} --all && \ + go list -f '{{.Dir}}/...' -m | xargs go test ${BUILD_TAGS} ${RUN_NONE} && \ + go list -f '{{.Dir}}/...' -m | xargs go test -timeout=2m ${UNIT_TEST_TAGS} -race -cpu=1 + +# same as regular but no race test +experimental-module-no-race: + go list -f '{{.Dir}}/...' -m | xargs go vet ${BUILD_TAGS} --all && \ + go list -f '{{.Dir}}/...' -m | xargs go test ${BUILD_TAGS} ${RUN_NONE} && \ + go list -f '{{.Dir}}/...' -m | xargs go test -timeout=2m ${UNIT_TEST_TAGS} -cpu=1 + + unit-modules-%: @# unit command that uses the pattern to define the root path that the @# module testing will start from. Strips off the "unit-modules-" and @@ -510,6 +528,10 @@ vet-modules-%: && go run . -p $(subst _,/,$(subst vet-modules-,,$@)) ${EACHMODULE_FLAGS} \ "go vet ${BUILD_TAGS} --all ./..." +experimental-vet: + go list -f '{{.Dir}}/...' -m | xargs go vet ${BUILD_TAGS} --all + + sdkv1check: @echo "Checking for usage of AWS SDK for Go v1" @sdkv1usage=`go list -test -f '''{{ if not .Standard }}{{ range $$_, $$name := .Imports }} * {{ $$.ImportPath }} -> {{ $$name }}{{ print "\n" }}{{ end }}{{ range $$_, $$name := .TestImports }} *: {{ $$.ImportPath }} -> {{ $$name }}{{ print "\n" }}{{ end }}{{ end}}''' ./... | sort -u | grep '''/aws-sdk-go/'''`; \ diff --git a/go.work b/go.work new file mode 100644 index 00000000000..6c6e78d5726 --- /dev/null +++ b/go.work @@ -0,0 +1,435 @@ +go 1.21.13 + +use ( + ./ + ./aws/protocol/eventstream + ./config + ./credentials + ./example/service/dynamodb/createTable + ./example/service/dynamodb/scanItems + ./example/service/s3/listObjects + ./example/service/s3/usingPrivateLink + ./feature/cloudfront/sign + ./feature/dynamodb/attributevalue + ./feature/dynamodb/expression + ./feature/dynamodbstreams/attributevalue + ./feature/ec2/imds + ./feature/ec2/imds/internal/configtesting + ./feature/rds/auth + ./feature/s3/manager + ./internal/codegen + ./internal/configsources + ./internal/configsources/configtesting + ./internal/endpoints/v2 + ./internal/ini + ./internal/protocoltest/awsrestjson + ./internal/protocoltest/ec2query + ./internal/protocoltest/jsonrpc + ./internal/protocoltest/jsonrpc10 + ./internal/protocoltest/query + ./internal/protocoltest/restxml + ./internal/protocoltest/restxmlwithnamespace + ./internal/protocoltest/smithyrpcv2cbor + ./internal/repotools + ./internal/v4a + ./service/accessanalyzer + ./service/account + ./service/acm + ./service/acmpca + ./service/amp + ./service/amplify + ./service/amplifybackend + ./service/amplifyuibuilder + ./service/apigateway + ./service/apigatewaymanagementapi + ./service/apigatewayv2 + ./service/appconfig + ./service/appconfigdata + ./service/appfabric + ./service/appflow + ./service/appintegrations + ./service/applicationautoscaling + ./service/applicationcostprofiler + ./service/applicationdiscoveryservice + ./service/applicationinsights + ./service/applicationsignals + ./service/appmesh + ./service/apprunner + ./service/appstream + ./service/appsync + ./service/apptest + ./service/arczonalshift + ./service/artifact + ./service/athena + ./service/auditmanager + ./service/autoscaling + ./service/autoscalingplans + ./service/b2bi + ./service/backup + ./service/backupgateway + ./service/batch + ./service/bcmdataexports + ./service/bedrock + ./service/bedrockagent + ./service/bedrockagentruntime + ./service/bedrockruntime + ./service/billingconductor + ./service/braket + ./service/budgets + ./service/chatbot + ./service/chime + ./service/chimesdkidentity + ./service/chimesdkmediapipelines + ./service/chimesdkmeetings + ./service/chimesdkmessaging + ./service/chimesdkvoice + ./service/cleanrooms + ./service/cleanroomsml + ./service/cloud9 + ./service/cloudcontrol + ./service/clouddirectory + ./service/cloudformation + ./service/cloudfront + ./service/cloudfrontkeyvaluestore + ./service/cloudhsm + ./service/cloudhsmv2 + ./service/cloudsearch + ./service/cloudsearchdomain + ./service/cloudtrail + ./service/cloudtraildata + ./service/cloudwatch + ./service/cloudwatchevents + ./service/cloudwatchlogs + ./service/codeartifact + ./service/codebuild + ./service/codecatalyst + ./service/codecommit + ./service/codeconnections + ./service/codedeploy + ./service/codeguruprofiler + ./service/codegurureviewer + ./service/codegurusecurity + ./service/codepipeline + ./service/codestarconnections + ./service/codestarnotifications + ./service/cognitoidentity + ./service/cognitoidentityprovider + ./service/cognitosync + ./service/comprehend + ./service/comprehendmedical + ./service/computeoptimizer + ./service/configservice + ./service/connect + ./service/connectcampaigns + ./service/connectcases + ./service/connectcontactlens + ./service/connectparticipant + ./service/controlcatalog + ./service/controltower + ./service/costandusagereportservice + ./service/costexplorer + ./service/costoptimizationhub + ./service/customerprofiles + ./service/databasemigrationservice + ./service/databrew + ./service/dataexchange + ./service/datapipeline + ./service/datasync + ./service/datazone + ./service/dax + ./service/deadline + ./service/detective + ./service/devicefarm + ./service/devopsguru + ./service/directconnect + ./service/directoryservice + ./service/directoryservicedata + ./service/dlm + ./service/docdb + ./service/docdbelastic + ./service/drs + ./service/dynamodb + ./service/dynamodbstreams + ./service/ebs + ./service/ec2 + ./service/ec2instanceconnect + ./service/ecr + ./service/ecrpublic + ./service/ecs + ./service/efs + ./service/eks + ./service/eksauth + ./service/elasticache + ./service/elasticbeanstalk + ./service/elasticinference + ./service/elasticloadbalancing + ./service/elasticloadbalancingv2 + ./service/elasticsearchservice + ./service/elastictranscoder + ./service/emr + ./service/emrcontainers + ./service/emrserverless + ./service/entityresolution + ./service/eventbridge + ./service/evidently + ./service/finspace + ./service/finspacedata + ./service/firehose + ./service/fis + ./service/fms + ./service/forecast + ./service/forecastquery + ./service/frauddetector + ./service/freetier + ./service/fsx + ./service/gamelift + ./service/geomaps + ./service/geoplaces + ./service/georoutes + ./service/glacier + ./service/globalaccelerator + ./service/glue + ./service/grafana + ./service/greengrass + ./service/greengrassv2 + ./service/groundstation + ./service/guardduty + ./service/health + ./service/healthlake + ./service/iam + ./service/identitystore + ./service/imagebuilder + ./service/inspector + ./service/inspector2 + ./service/inspectorscan + ./service/internal/accept-encoding + ./service/internal/benchmark + ./service/internal/checksum + ./service/internal/endpoint-discovery + ./service/internal/eventstreamtesting + ./service/internal/integrationtest + ./service/internal/presigned-url + ./service/internal/s3shared + ./service/internetmonitor + ./service/iot + ./service/iot1clickdevicesservice + ./service/iot1clickprojects + ./service/iotanalytics + ./service/iotdataplane + ./service/iotdeviceadvisor + ./service/iotevents + ./service/ioteventsdata + ./service/iotfleethub + ./service/iotfleetwise + ./service/iotjobsdataplane + ./service/iotsecuretunneling + ./service/iotsitewise + ./service/iotthingsgraph + ./service/iottwinmaker + ./service/iotwireless + ./service/ivs + ./service/ivschat + ./service/ivsrealtime + ./service/kafka + ./service/kafkaconnect + ./service/kendra + ./service/kendraranking + ./service/keyspaces + ./service/kinesis + ./service/kinesis/internal/testing + ./service/kinesisanalytics + ./service/kinesisanalyticsv2 + ./service/kinesisvideo + ./service/kinesisvideoarchivedmedia + ./service/kinesisvideomedia + ./service/kinesisvideosignaling + ./service/kinesisvideowebrtcstorage + ./service/kms + ./service/lakeformation + ./service/lambda + ./service/launchwizard + ./service/lexmodelbuildingservice + ./service/lexmodelsv2 + ./service/lexruntimeservice + ./service/lexruntimev2 + ./service/licensemanager + ./service/licensemanagerlinuxsubscriptions + ./service/licensemanagerusersubscriptions + ./service/lightsail + ./service/location + ./service/lookoutequipment + ./service/lookoutmetrics + ./service/lookoutvision + ./service/m2 + ./service/machinelearning + ./service/macie2 + ./service/mailmanager + ./service/managedblockchain + ./service/managedblockchainquery + ./service/marketplaceagreement + ./service/marketplacecatalog + ./service/marketplacecommerceanalytics + ./service/marketplacedeployment + ./service/marketplaceentitlementservice + ./service/marketplacemetering + ./service/marketplacereporting + ./service/mediaconnect + ./service/mediaconvert + ./service/medialive + ./service/mediapackage + ./service/mediapackagev2 + ./service/mediapackagevod + ./service/mediastore + ./service/mediastoredata + ./service/mediatailor + ./service/medicalimaging + ./service/memorydb + ./service/mgn + ./service/migrationhub + ./service/migrationhubconfig + ./service/migrationhuborchestrator + ./service/migrationhubrefactorspaces + ./service/migrationhubstrategy + ./service/mq + ./service/mturk + ./service/mwaa + ./service/neptune + ./service/neptunedata + ./service/neptunegraph + ./service/networkfirewall + ./service/networkmanager + ./service/networkmonitor + ./service/oam + ./service/omics + ./service/opensearch + ./service/opensearchserverless + ./service/opsworks + ./service/opsworkscm + ./service/organizations + ./service/osis + ./service/outposts + ./service/panorama + ./service/paymentcryptography + ./service/paymentcryptographydata + ./service/pcaconnectorad + ./service/pcaconnectorscep + ./service/pcs + ./service/personalize + ./service/personalizeevents + ./service/personalizeruntime + ./service/pi + ./service/pinpoint + ./service/pinpointemail + ./service/pinpointsmsvoice + ./service/pinpointsmsvoicev2 + ./service/pipes + ./service/polly + ./service/pricing + ./service/privatenetworks + ./service/proton + ./service/qapps + ./service/qbusiness + ./service/qconnect + ./service/qldb + ./service/qldbsession + ./service/quicksight + ./service/ram + ./service/rbin + ./service/rds + ./service/rdsdata + ./service/redshift + ./service/redshiftdata + ./service/redshiftserverless + ./service/rekognition + ./service/repostspace + ./service/resiliencehub + ./service/resourceexplorer2 + ./service/resourcegroups + ./service/resourcegroupstaggingapi + ./service/robomaker + ./service/rolesanywhere + ./service/route53 + ./service/route53domains + ./service/route53profiles + ./service/route53recoverycluster + ./service/route53recoverycontrolconfig + ./service/route53recoveryreadiness + ./service/route53resolver + ./service/rum + ./service/s3 + ./service/s3/internal/configtesting + ./service/s3control + ./service/s3outposts + ./service/sagemaker + ./service/sagemakera2iruntime + ./service/sagemakeredge + ./service/sagemakerfeaturestoreruntime + ./service/sagemakergeospatial + ./service/sagemakermetrics + ./service/sagemakerruntime + ./service/savingsplans + ./service/scheduler + ./service/schemas + ./service/secretsmanager + ./service/securityhub + ./service/securitylake + ./service/serverlessapplicationrepository + ./service/servicecatalog + ./service/servicecatalogappregistry + ./service/servicediscovery + ./service/servicequotas + ./service/ses + ./service/sesv2 + ./service/sfn + ./service/shield + ./service/signer + ./service/simspaceweaver + ./service/sms + ./service/snowball + ./service/snowdevicemanagement + ./service/sns + ./service/socialmessaging + ./service/sqs + ./service/ssm + ./service/ssmcontacts + ./service/ssmincidents + ./service/ssmquicksetup + ./service/ssmsap + ./service/sso + ./service/ssoadmin + ./service/ssooidc + ./service/storagegateway + ./service/sts + ./service/supplychain + ./service/support + ./service/supportapp + ./service/swf + ./service/synthetics + ./service/taxsettings + ./service/textract + ./service/timestreaminfluxdb + ./service/timestreamquery + ./service/timestreamwrite + ./service/tnb + ./service/transcribe + ./service/transcribestreaming + ./service/transcribestreaming/internal/testing + ./service/transfer + ./service/translate + ./service/trustedadvisor + ./service/verifiedpermissions + ./service/voiceid + ./service/vpclattice + ./service/waf + ./service/wafregional + ./service/wafv2 + ./service/wellarchitected + ./service/wisdom + ./service/workdocs + ./service/workmail + ./service/workmailmessageflow + ./service/workspaces + ./service/workspacesthinclient + ./service/workspacesweb + ./service/xray +)