From 883b03e1357563ca3c33cb5f87a9c529740671a5 Mon Sep 17 00:00:00 2001 From: rsteube Date: Fri, 21 Nov 2025 13:43:08 +0100 Subject: [PATCH] added test --- .github/workflows/aws-template.yml | 25 ++ .github/workflows/aws.yml | 447 +++++++++++++++++++++++++++++ .github/workflows/go.yml | 2 +- .gitignore | 1 + cmd/carapace-aws/main_test.go | 62 ++++ go.mod | 3 +- go.sum | 6 +- 7 files changed, 542 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/aws-template.yml create mode 100644 .github/workflows/aws.yml create mode 100644 cmd/carapace-aws/main_test.go diff --git a/.github/workflows/aws-template.yml b/.github/workflows/aws-template.yml new file mode 100644 index 0000000000..ec21741140 --- /dev/null +++ b/.github/workflows/aws-template.yml @@ -0,0 +1,25 @@ +name: aws template + +on: + workflow_call: + inputs: + service: + required: true + type: string + +jobs: + compare: + runs-on: ubuntu-latest + container: amazon/aws-cli:2.32.2 + + steps: + - uses: actions/download-artifact@v6 + with: + name: carapace-aws + path: /usr/local/bin/ + + - name: fix permissions + run: chmod +x /usr/local/bin/carapace-aws* + + - name: run carapace-aws.test + run: SERVICE=${{ inputs.service }} carapace-aws.test diff --git a/.github/workflows/aws.yml b/.github/workflows/aws.yml new file mode 100644 index 0000000000..d9e8dc8816 --- /dev/null +++ b/.github/workflows/aws.yml @@ -0,0 +1,447 @@ +name: aws + +on: + workflow_run: + workflows: [Go] + types: [completed] + +jobs: + build: + runs-on: ubuntu-latest + container: ghcr.io/carapace-sh/go:1.23.1 + steps: + - name: shallow clone + uses: actions/checkout@v5 + + - name: fix git safe.directory + run: git config --global --add safe.directory '*' + + - name: Generate + run: go generate ./... + + - name: Build + run: go build -C cmd/carapace-aws -v . + + - name: Build Test + run: go test -C cmd/carapace-aws -tags integration -run TestServices -c . + + - uses: actions/upload-artifact@v5 + with: + name: carapace-aws + path: | + cmd/carapace-aws/carapace-aws + cmd/carapace-aws/carapace-aws.test + retention-days: 1 + + accessanalyzer: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: accessanalyzer}} + account: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: account}} + acm: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: acm}} + acm-pca: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: acm-pca}} + aiops: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: aiops}} + amp: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: amp}} + amplify: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: amplify}} + amplifybackend: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: amplifybackend}} + amplifyuibuilder: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: amplifyuibuilder}} + apigateway: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: apigateway}} + apigatewaymanagementapi: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: apigatewaymanagementapi}} + apigatewayv2: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: apigatewayv2}} + appconfig: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: appconfig}} + appconfigdata: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: appconfigdata}} + appfabric: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: appfabric}} + appflow: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: appflow}} + appintegrations: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: appintegrations}} + application-autoscaling: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: application-autoscaling}} + application-insights: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: application-insights}} + application-signals: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: application-signals}} + applicationcostprofiler: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: applicationcostprofiler}} + appmesh: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: appmesh}} + apprunner: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: apprunner}} + appstream: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: appstream}} + appsync: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: appsync}} + arc-region-switch: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: arc-region-switch}} + arc-zonal-shift: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: arc-zonal-shift}} + artifact: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: artifact}} + athena: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: athena}} + auditmanager: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: auditmanager}} + autoscaling: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: autoscaling}} + autoscaling-plans: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: autoscaling-plans}} + b2bi: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: b2bi}} + backup: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: backup}} + backup-gateway: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: backup-gateway}} + backupsearch: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: backupsearch}} + batch: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: batch}} + bcm-dashboards: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: bcm-dashboards}} + bcm-data-exports: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: bcm-data-exports}} + bcm-pricing-calculator: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: bcm-pricing-calculator}} + bcm-recommended-actions: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: bcm-recommended-actions}} + bedrock: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: bedrock}} + bedrock-agent: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: bedrock-agent}} + bedrock-agent-runtime: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: bedrock-agent-runtime}} + bedrock-agentcore: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: bedrock-agentcore}} + bedrock-agentcore-control: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: bedrock-agentcore-control}} + bedrock-data-automation: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: bedrock-data-automation}} + bedrock-data-automation-runtime: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: bedrock-data-automation-runtime}} + bedrock-runtime: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: bedrock-runtime}} + billing: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: billing}} + billingconductor: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: billingconductor}} + braket: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: braket}} + budgets: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: budgets}} + ce: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: ce}} + chatbot: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: chatbot}} + chime: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: chime}} + chime-sdk-identity: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: chime-sdk-identity}} + chime-sdk-media-pipelines: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: chime-sdk-media-pipelines}} + chime-sdk-meetings: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: chime-sdk-meetings}} + chime-sdk-messaging: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: chime-sdk-messaging}} + chime-sdk-voice: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: chime-sdk-voice}} + cleanrooms: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: cleanrooms}} + cleanroomsml: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: cleanroomsml}} + cli-dev: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: cli-dev}} + cloud9: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: cloud9}} + cloudcontrol: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: cloudcontrol}} + clouddirectory: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: clouddirectory}} + cloudformation: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: cloudformation}} + cloudfront: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: cloudfront}} + cloudfront-keyvaluestore: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: cloudfront-keyvaluestore}} + cloudhsm: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: cloudhsm}} + cloudhsmv2: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: cloudhsmv2}} + cloudsearch: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: cloudsearch}} + cloudsearchdomain: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: cloudsearchdomain}} + cloudtrail: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: cloudtrail}} + cloudtrail-data: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: cloudtrail-data}} + cloudwatch: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: cloudwatch}} + codeartifact: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: codeartifact}} + codebuild: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: codebuild}} + codecatalyst: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: codecatalyst}} + codecommit: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: codecommit}} + codeconnections: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: codeconnections}} + codeguru-reviewer: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: codeguru-reviewer}} + codeguru-security: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: codeguru-security}} + codeguruprofiler: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: codeguruprofiler}} + codepipeline: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: codepipeline}} + codestar-connections: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: codestar-connections}} + codestar-notifications: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: codestar-notifications}} + cognito-identity: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: cognito-identity}} + cognito-idp: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: cognito-idp}} + cognito-sync: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: cognito-sync}} + comprehend: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: comprehend}} + comprehendmedical: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: comprehendmedical}} + compute-optimizer: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: compute-optimizer}} + configservice: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: configservice}} + configure: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: configure}} + connect: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: connect}} + connect-contact-lens: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: connect-contact-lens}} + connectcampaigns: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: connectcampaigns}} + connectcampaignsv2: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: connectcampaignsv2}} + connectcases: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: connectcases}} + connectparticipant: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: connectparticipant}} + controlcatalog: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: controlcatalog}} + controltower: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: controltower}} + cost-optimization-hub: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: cost-optimization-hub}} + cur: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: cur}} + customer-profiles: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: customer-profiles}} + databrew: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: databrew}} + dataexchange: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: dataexchange}} + datapipeline: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: datapipeline}} + datasync: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: datasync}} + datazone: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: datazone}} + dax: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: dax}} + ddb: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: ddb}} + deadline: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: deadline}} + deploy: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: deploy}} + detective: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: detective}} + devicefarm: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: devicefarm}} + devops-guru: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: devops-guru}} + directconnect: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: directconnect}} + discovery: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: discovery}} + dlm: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: dlm}} + dms: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: dms}} + docdb: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: docdb}} + docdb-elastic: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: docdb-elastic}} + drs: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: drs}} + ds: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: ds}} + ds-data: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: ds-data}} + dsql: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: dsql}} + dynamodb: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: dynamodb}} + dynamodbstreams: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: dynamodbstreams}} + ebs: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: ebs}} + ec2: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: ec2}} + ec2-instance-connect: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: ec2-instance-connect}} + ecr: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: ecr}} + ecr-public: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: ecr-public}} + ecs: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: ecs}} + efs: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: efs}} + eks: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: eks}} + eks-auth: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: eks-auth}} + elasticache: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: elasticache}} + elasticbeanstalk: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: elasticbeanstalk}} + elastictranscoder: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: elastictranscoder}} + elb: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: elb}} + elbv2: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: elbv2}} + emr: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: emr}} + emr-containers: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: emr-containers}} + emr-serverless: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: emr-serverless}} + entityresolution: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: entityresolution}} + es: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: es}} + events: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: events}} + evidently: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: evidently}} + evs: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: evs}} + finspace: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: finspace}} + finspace-data: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: finspace-data}} + firehose: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: firehose}} + fis: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: fis}} + fms: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: fms}} + forecast: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: forecast}} + forecastquery: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: forecastquery}} + frauddetector: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: frauddetector}} + freetier: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: freetier}} + fsx: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: fsx}} + gamelift: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: gamelift}} + gameliftstreams: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: gameliftstreams}} + geo-maps: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: geo-maps}} + geo-places: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: geo-places}} + geo-routes: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: geo-routes}} + glacier: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: glacier}} + globalaccelerator: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: globalaccelerator}} + glue: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: glue}} + grafana: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: grafana}} + greengrass: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: greengrass}} + greengrassv2: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: greengrassv2}} + groundstation: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: groundstation}} + guardduty: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: guardduty}} + health: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: health}} + healthlake: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: healthlake}} + history: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: history}} + iam: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: iam}} + identitystore: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: identitystore}} + imagebuilder: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: imagebuilder}} + importexport: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: importexport}} + inspector: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: inspector}} + inspector-scan: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: inspector-scan}} + inspector2: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: inspector2}} + internetmonitor: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: internetmonitor}} + invoicing: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: invoicing}} + iot: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: iot}} + iot-data: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: iot-data}} + iot-jobs-data: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: iot-jobs-data}} + iot-managed-integrations: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: iot-managed-integrations}} + iotanalytics: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: iotanalytics}} + iotdeviceadvisor: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: iotdeviceadvisor}} + iotevents: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: iotevents}} + iotevents-data: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: iotevents-data}} + iotfleetwise: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: iotfleetwise}} + iotsecuretunneling: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: iotsecuretunneling}} + iotsitewise: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: iotsitewise}} + iotthingsgraph: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: iotthingsgraph}} + iottwinmaker: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: iottwinmaker}} + iotwireless: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: iotwireless}} + ivs: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: ivs}} + ivs-realtime: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: ivs-realtime}} + ivschat: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: ivschat}} + kafka: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: kafka}} + kafkaconnect: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: kafkaconnect}} + kendra: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: kendra}} + kendra-ranking: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: kendra-ranking}} + keyspaces: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: keyspaces}} + keyspacesstreams: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: keyspacesstreams}} + kinesis: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: kinesis}} + kinesis-video-archived-media: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: kinesis-video-archived-media}} + kinesis-video-media: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: kinesis-video-media}} + kinesis-video-signaling: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: kinesis-video-signaling}} + kinesis-video-webrtc-storage: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: kinesis-video-webrtc-storage}} + kinesisanalytics: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: kinesisanalytics}} + kinesisanalyticsv2: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: kinesisanalyticsv2}} + kinesisvideo: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: kinesisvideo}} + kms: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: kms}} + lakeformation: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: lakeformation}} + lambda: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: lambda}} + launch-wizard: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: launch-wizard}} + lex-models: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: lex-models}} + lex-runtime: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: lex-runtime}} + lexv2-models: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: lexv2-models}} + lexv2-runtime: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: lexv2-runtime}} + license-manager: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: license-manager}} + license-manager-linux-subscriptions: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: license-manager-linux-subscriptions}} + license-manager-user-subscriptions: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: license-manager-user-subscriptions}} + lightsail: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: lightsail}} + location: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: location}} + logs: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: logs}} + lookoutequipment: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: lookoutequipment}} + m2: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: m2}} + machinelearning: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: machinelearning}} + macie2: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: macie2}} + mailmanager: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: mailmanager}} + managedblockchain: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: managedblockchain}} + managedblockchain-query: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: managedblockchain-query}} + marketplace-agreement: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: marketplace-agreement}} + marketplace-catalog: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: marketplace-catalog}} + marketplace-deployment: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: marketplace-deployment}} + marketplace-entitlement: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: marketplace-entitlement}} + marketplace-reporting: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: marketplace-reporting}} + marketplacecommerceanalytics: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: marketplacecommerceanalytics}} + mediaconnect: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: mediaconnect}} + mediaconvert: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: mediaconvert}} + medialive: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: medialive}} + mediapackage: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: mediapackage}} + mediapackage-vod: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: mediapackage-vod}} + mediapackagev2: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: mediapackagev2}} + mediastore: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: mediastore}} + mediastore-data: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: mediastore-data}} + mediatailor: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: mediatailor}} + medical-imaging: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: medical-imaging}} + memorydb: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: memorydb}} + meteringmarketplace: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: meteringmarketplace}} + mgh: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: mgh}} + mgn: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: mgn}} + migration-hub-refactor-spaces: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: migration-hub-refactor-spaces}} + migrationhub-config: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: migrationhub-config}} + migrationhuborchestrator: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: migrationhuborchestrator}} + migrationhubstrategy: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: migrationhubstrategy}} + mpa: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: mpa}} + mq: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: mq}} + mturk: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: mturk}} + mwaa: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: mwaa}} + neptune: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: neptune}} + neptune-graph: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: neptune-graph}} + neptunedata: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: neptunedata}} + network-firewall: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: network-firewall}} + networkflowmonitor: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: networkflowmonitor}} + networkmanager: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: networkmanager}} + networkmonitor: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: networkmonitor}} + notifications: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: notifications}} + notificationscontacts: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: notificationscontacts}} + oam: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: oam}} + observabilityadmin: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: observabilityadmin}} + odb: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: odb}} + omics: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: omics}} + opensearch: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: opensearch}} + opensearchserverless: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: opensearchserverless}} + organizations: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: organizations}} + osis: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: osis}} + outposts: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: outposts}} + panorama: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: panorama}} + partnercentral-selling: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: partnercentral-selling}} + payment-cryptography: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: payment-cryptography}} + payment-cryptography-data: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: payment-cryptography-data}} + pca-connector-ad: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: pca-connector-ad}} + pca-connector-scep: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: pca-connector-scep}} + pcs: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: pcs}} + personalize: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: personalize}} + personalize-events: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: personalize-events}} + personalize-runtime: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: personalize-runtime}} + pi: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: pi}} + pinpoint: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: pinpoint}} + pinpoint-email: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: pinpoint-email}} + pinpoint-sms-voice: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: pinpoint-sms-voice}} + pinpoint-sms-voice-v2: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: pinpoint-sms-voice-v2}} + pipes: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: pipes}} + polly: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: polly}} + pricing: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: pricing}} + proton: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: proton}} + qapps: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: qapps}} + qbusiness: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: qbusiness}} + qconnect: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: qconnect}} + quicksight: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: quicksight}} + ram: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: ram}} + rbin: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: rbin}} + rds: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: rds}} + rds-data: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: rds-data}} + redshift: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: redshift}} + redshift-data: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: redshift-data}} + redshift-serverless: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: redshift-serverless}} + rekognition: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: rekognition}} + repostspace: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: repostspace}} + resiliencehub: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: resiliencehub}} + resource-explorer-2: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: resource-explorer-2}} + resource-groups: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: resource-groups}} + resourcegroupstaggingapi: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: resourcegroupstaggingapi}} + rolesanywhere: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: rolesanywhere}} + route53: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: route53}} + route53-recovery-cluster: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: route53-recovery-cluster}} + route53-recovery-control-config: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: route53-recovery-control-config}} + route53-recovery-readiness: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: route53-recovery-readiness}} + route53domains: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: route53domains}} + route53profiles: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: route53profiles}} + route53resolver: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: route53resolver}} + rtbfabric: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: rtbfabric}} + rum: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: rum}} + s3: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: s3}} + s3api: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: s3api}} + s3control: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: s3control}} + s3outposts: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: s3outposts}} + s3tables: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: s3tables}} + s3vectors: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: s3vectors}} + sagemaker: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: sagemaker}} + sagemaker-a2i-runtime: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: sagemaker-a2i-runtime}} + sagemaker-edge: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: sagemaker-edge}} + sagemaker-featurestore-runtime: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: sagemaker-featurestore-runtime}} + sagemaker-geospatial: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: sagemaker-geospatial}} + sagemaker-metrics: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: sagemaker-metrics}} + sagemaker-runtime: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: sagemaker-runtime}} + savingsplans: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: savingsplans}} + scheduler: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: scheduler}} + schemas: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: schemas}} + sdb: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: sdb}} + secretsmanager: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: secretsmanager}} + security-ir: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: security-ir}} + securityhub: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: securityhub}} + securitylake: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: securitylake}} + serverlessrepo: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: serverlessrepo}} + service-quotas: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: service-quotas}} + servicecatalog: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: servicecatalog}} + servicecatalog-appregistry: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: servicecatalog-appregistry}} + servicediscovery: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: servicediscovery}} + ses: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: ses}} + sesv2: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: sesv2}} + shield: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: shield}} + signer: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: signer}} + simspaceweaver: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: simspaceweaver}} + snow-device-management: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: snow-device-management}} + snowball: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: snowball}} + sns: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: sns}} + socialmessaging: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: socialmessaging}} + sqs: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: sqs}} + ssm: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: ssm}} + ssm-contacts: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: ssm-contacts}} + ssm-guiconnect: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: ssm-guiconnect}} + ssm-incidents: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: ssm-incidents}} + ssm-quicksetup: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: ssm-quicksetup}} + ssm-sap: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: ssm-sap}} + sso: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: sso}} + sso-admin: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: sso-admin}} + sso-oidc: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: sso-oidc}} + stepfunctions: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: stepfunctions}} + storagegateway: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: storagegateway}} + sts: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: sts}} + supplychain: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: supplychain}} + support: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: support}} + support-app: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: support-app}} + swf: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: swf}} + synthetics: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: synthetics}} + taxsettings: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: taxsettings}} + textract: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: textract}} + timestream-influxdb: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: timestream-influxdb}} + timestream-query: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: timestream-query}} + timestream-write: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: timestream-write}} + tnb: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: tnb}} + transcribe: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: transcribe}} + transfer: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: transfer}} + translate: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: translate}} + trustedadvisor: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: trustedadvisor}} + verifiedpermissions: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: verifiedpermissions}} + voice-id: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: voice-id}} + vpc-lattice: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: vpc-lattice}} + waf: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: waf}} + waf-regional: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: waf-regional}} + wafv2: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: wafv2}} + wellarchitected: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: wellarchitected}} + wisdom: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: wisdom}} + workdocs: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: workdocs}} + workmail: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: workmail}} + workmailmessageflow: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: workmailmessageflow}} + workspaces: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: workspaces}} + workspaces-instances: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: workspaces-instances}} + workspaces-thin-client: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: workspaces-thin-client}} + workspaces-web: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: workspaces-web}} + xray: {needs: build, uses: ./.github/workflows/aws-template.yml, with: {service: xray}} + diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 6adc299eba..8bb1c33aa9 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -27,7 +27,7 @@ jobs: run: go generate ./... - name: Build - run: go build -v ./... + run: ls cmd/ | xargs -I'{}' sh -c "cd ./cmd/{} && go build -v ." - name: Test run: go test -v -coverprofile=profile.cov ./... diff --git a/.gitignore b/.gitignore index b5b99f76cf..e77f2fa9bd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ cmd/carapace-aws/carapace-aws +cmd/carapace-aws/carapace-aws.test cmd/carapace-aws/cmd/botocore/botocore_generated.go dist docs/book diff --git a/cmd/carapace-aws/main_test.go b/cmd/carapace-aws/main_test.go new file mode 100644 index 0000000000..d040bfffa8 --- /dev/null +++ b/cmd/carapace-aws/main_test.go @@ -0,0 +1,62 @@ +//go:build integration + +package main + +import ( + "fmt" + "os" + "strings" + "testing" + + "github.com/carapace-sh/carapace" + "github.com/carapace-sh/carapace-aws/cmd/carapace-aws/cmd/botocore" + "github.com/carapace-sh/carapace-bridge/pkg/actions/bridge" +) + +func TestService(t *testing.T) { + serviceToTest := os.Getenv("SERVICE") + for service := range botocore.Services() { + t.Run(service, func(t *testing.T) { + if serviceToTest != "" && service != serviceToTest { // TODO env var to only test a specific service + t.SkipNow() + } + + patch := carapace.DiffPatch( + bridge.ActionAws("aws"), + bridge.ActionCarapaceBin("aws"), + carapace.NewContext(service, ""), + ) + for _, line := range patch { + switch { + case strings.HasPrefix(line, "-"): + fmt.Printf("\033[0;31m%v\033[0m\n", line) + t.Fail() + case strings.HasPrefix(line, "+"): + fmt.Printf("\033[0;32m%v\033[0m\n", line) + t.Fail() + } + } + + for operation := range botocore.Operations("ec2") { + t.Run(operation, func(t *testing.T) { + t.Parallel() + patch := carapace.DiffPatch( + bridge.ActionAws("aws"), + bridge.ActionCarapaceBin("aws"), + carapace.NewContext(service, operation, "--"), + ) + for _, line := range patch { + switch { + case strings.HasPrefix(line, "-"): + fmt.Printf("\033[0;31m%v\033[0m\n", line) + t.Fail() + case strings.HasPrefix(line, "+"): + fmt.Printf("\033[0;32m%v\033[0m\n", line) + t.Fail() + } + } + }) + } + }) + } +} diff --git a/go.mod b/go.mod index a9c2716b62..26d50c3517 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,8 @@ go 1.23.1 require ( github.com/JohannesKaufmann/html-to-markdown/v2 v2.4.0 - github.com/carapace-sh/carapace v1.10.2 + github.com/carapace-sh/carapace v1.10.3-0.20251121151734-35d09b66ce03 + github.com/carapace-sh/carapace-bridge v1.4.9-0.20251121151755-1d6615a99cba github.com/carapace-sh/carapace-spec v1.3.5 github.com/neurosnap/sentences v1.1.2 github.com/spf13/cobra v1.10.1 diff --git a/go.sum b/go.sum index 7a7b3f9c7b..f5f2fac125 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,10 @@ github.com/JohannesKaufmann/dom v0.2.0 h1:1bragmEb19K8lHAqgFgqCpiPCFEZMTXzOIEjux github.com/JohannesKaufmann/dom v0.2.0/go.mod h1:57iSUl5RKric4bUkgos4zu6Xt5LMHUnw3TF1l5CbGZo= github.com/JohannesKaufmann/html-to-markdown/v2 v2.4.0 h1:C0/TerKdQX9Y9pbYi1EsLr5LDNANsqunyI/btpyfCg8= github.com/JohannesKaufmann/html-to-markdown/v2 v2.4.0/go.mod h1:OLaKh+giepO8j7teevrNwiy/fwf8LXgoc9g7rwaE1jk= -github.com/carapace-sh/carapace v1.10.2 h1:2E4i2ZCjjROSinQrS+AIWTYk0YAaolDJppULLZmXmj8= -github.com/carapace-sh/carapace v1.10.2/go.mod h1:gdyqmVIQJFlcHn4D7BkgyjRU5LlluDXBaiRSdV6GY88= +github.com/carapace-sh/carapace v1.10.3-0.20251121151734-35d09b66ce03 h1:KhLGaJ6CV3ly9GD6SeT6fFGzoneeJtF/hqYiNvAF+kY= +github.com/carapace-sh/carapace v1.10.3-0.20251121151734-35d09b66ce03/go.mod h1:gdyqmVIQJFlcHn4D7BkgyjRU5LlluDXBaiRSdV6GY88= +github.com/carapace-sh/carapace-bridge v1.4.9-0.20251121151755-1d6615a99cba h1:wRKtTniKuAb43EBw0YlySaG6kLLp874V0aC7UvK19Kg= +github.com/carapace-sh/carapace-bridge v1.4.9-0.20251121151755-1d6615a99cba/go.mod h1:5pjJSa9xLmJafNACZSoAMs3uGD4KVbXMqzYIk/r8CkA= github.com/carapace-sh/carapace-shlex v1.1.1 h1:ccmNeetAYZOk4IcV36youFDsXusT9uCNW2Njkw+QS+Q= github.com/carapace-sh/carapace-shlex v1.1.1/go.mod h1:lJ4ZsdxytE0wHJ8Ta9S7Qq0XpjgjU0mdfCqiI2FHx7M= github.com/carapace-sh/carapace-spec v1.3.5 h1:F/OS1CQciwTtyZbaPsOz5jQwtzbjHUoPCjCClELbb+s=