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

chore: Add payer account precheck for CE tests #38529

Merged
merged 1 commit into from
Jul 29, 2024

Conversation

acwwat
Copy link
Contributor

@acwwat acwwat commented Jul 25, 2024

Description

This PR is to add prechecks for payer accounts to the acceptance tests for the aws_ce_cost_allocation_tag resource, and the aws_ce_cost_category resource and data source.

Relations

Closes #38465

References

n/a

Output from Acceptance Testing

In a non-payer/org member account:

$ make testacc TESTS="TestAccCECostAllocationTag|TestAccCECostCategory" PKG=ce
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.5 test ./internal/service/ce/... -v -count 1 -parallel 20 -run='TestAccCECostAllocationTag|TestAccCECostCategory'  -timeout 360m
=== RUN   TestAccCECostAllocationTag_basic
=== PAUSE TestAccCECostAllocationTag_basic
=== RUN   TestAccCECostAllocationTag_disappears
=== PAUSE TestAccCECostAllocationTag_disappears
=== RUN   TestAccCECostCategoryDataSource_basic
=== PAUSE TestAccCECostCategoryDataSource_basic
=== RUN   TestAccCECostCategory_basic
=== PAUSE TestAccCECostCategory_basic
=== RUN   TestAccCECostCategory_effectiveStart
=== PAUSE TestAccCECostCategory_effectiveStart
=== RUN   TestAccCECostCategory_disappears
=== PAUSE TestAccCECostCategory_disappears
=== RUN   TestAccCECostCategory_complete
=== PAUSE TestAccCECostCategory_complete
=== RUN   TestAccCECostCategory_notWithAnd
=== PAUSE TestAccCECostCategory_notWithAnd
=== RUN   TestAccCECostCategory_splitCharge
=== PAUSE TestAccCECostCategory_splitCharge
=== RUN   TestAccCECostCategory_tags
=== PAUSE TestAccCECostCategory_tags
=== CONT  TestAccCECostAllocationTag_basic
=== CONT  TestAccCECostCategory_disappears
=== CONT  TestAccCECostCategory_basic
=== CONT  TestAccCECostCategoryDataSource_basic
=== CONT  TestAccCECostCategory_effectiveStart
=== CONT  TestAccCECostAllocationTag_disappears
=== CONT  TestAccCECostCategory_notWithAnd
=== CONT  TestAccCECostCategory_splitCharge
=== CONT  TestAccCECostCategory_tags
=== CONT  TestAccCECostCategory_complete
=== NAME  TestAccCECostAllocationTag_basic
    cost_allocation_tag_test.go:27: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCECostAllocationTag_basic (0.99s)
=== NAME  TestAccCECostAllocationTag_disappears
    cost_allocation_tag_test.go:74: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCECostAllocationTag_disappears (0.99s)
=== NAME  TestAccCECostCategory_splitCharge
    cost_category_test.go:191: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCECostCategory_splitCharge (1.01s)
=== NAME  TestAccCECostCategoryDataSource_basic
    cost_category_data_source_test.go:24: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCECostCategoryDataSource_basic (1.02s)
=== NAME  TestAccCECostCategory_basic
    cost_category_test.go:31: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCECostCategory_basic (1.02s)
=== NAME  TestAccCECostCategory_notWithAnd
    cost_category_test.go:163: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCECostCategory_notWithAnd (1.02s)
=== NAME  TestAccCECostCategory_disappears
    cost_category_test.go:104: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCECostCategory_disappears (1.02s)
=== NAME  TestAccCECostCategory_tags
    cost_category_test.go:226: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCECostCategory_tags (1.03s)
=== NAME  TestAccCECostCategory_effectiveStart
    cost_category_test.go:67: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCECostCategory_effectiveStart (1.03s)
=== NAME  TestAccCECostCategory_complete
    cost_category_test.go:128: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCECostCategory_complete (1.07s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/ce 1.282s

$

In a payer/org management account:

$ make testacc TESTS="TestAccCECostAllocationTag|TestAccCECostCategory" PKG=ce
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.5 test ./internal/service/ce/... -v -count 1 -parallel 20 -run='TestAccCECostAllocationTag|TestAccCECostCategory'  -timeout 360m
=== RUN   TestAccCECostAllocationTag_basic
=== PAUSE TestAccCECostAllocationTag_basic
=== RUN   TestAccCECostAllocationTag_disappears
=== PAUSE TestAccCECostAllocationTag_disappears
=== RUN   TestAccCECostCategoryDataSource_basic
=== PAUSE TestAccCECostCategoryDataSource_basic
=== RUN   TestAccCECostCategory_basic
=== PAUSE TestAccCECostCategory_basic
=== RUN   TestAccCECostCategory_effectiveStart
=== PAUSE TestAccCECostCategory_effectiveStart
=== RUN   TestAccCECostCategory_disappears
=== PAUSE TestAccCECostCategory_disappears
=== RUN   TestAccCECostCategory_complete
=== PAUSE TestAccCECostCategory_complete
=== RUN   TestAccCECostCategory_notWithAnd
=== PAUSE TestAccCECostCategory_notWithAnd
=== RUN   TestAccCECostCategory_splitCharge
=== PAUSE TestAccCECostCategory_splitCharge
=== RUN   TestAccCECostCategory_tags
=== PAUSE TestAccCECostCategory_tags
=== CONT  TestAccCECostAllocationTag_basic
=== CONT  TestAccCECostCategory_disappears
=== CONT  TestAccCECostCategory_tags
=== CONT  TestAccCECostCategory_effectiveStart
=== CONT  TestAccCECostCategoryDataSource_basic
=== CONT  TestAccCECostAllocationTag_disappears
=== CONT  TestAccCECostCategory_notWithAnd
=== CONT  TestAccCECostCategory_complete
=== CONT  TestAccCECostCategory_basic
=== CONT  TestAccCECostCategory_splitCharge
--- PASS: TestAccCECostAllocationTag_disappears (19.95s)
--- PASS: TestAccCECostCategoryDataSource_basic (21.12s)
--- PASS: TestAccCECostCategory_basic (25.67s)
--- PASS: TestAccCECostCategory_notWithAnd (27.97s)
--- PASS: TestAccCECostCategory_disappears (28.72s)
--- PASS: TestAccCECostCategory_complete (36.98s)
--- PASS: TestAccCECostCategory_effectiveStart (37.96s)
--- PASS: TestAccCECostCategory_splitCharge (43.34s)
--- PASS: TestAccCECostAllocationTag_basic (43.69s)
--- PASS: TestAccCECostCategory_tags (50.01s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/ce 50.340s

$

@acwwat acwwat requested a review from a team as a code owner July 25, 2024 04:17
Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@terraform-aws-provider terraform-aws-provider bot added tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/ce Issues and PRs that pertain to the ce service. size/S Managed by automation to categorize the size of a PR. labels Jul 25, 2024
@acwwat acwwat force-pushed the td-aws_ce-add_payer_precheck branch from 7cb82aa to 8b36d6e Compare July 25, 2024 04:19
@acwwat acwwat force-pushed the td-aws_ce-add_payer_precheck branch from 8b36d6e to 90fa9c8 Compare July 25, 2024 05:50
Copy link
Member

@jar-b jar-b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉

% make testacc PKG=ce TESTS="TestAccCECostAllocationTag|TestAccCECostCategory"
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.5 test ./internal/service/ce/... -v -count 1 -parallel 20 -run='TestAccCECostAllocationTag|TestAccCECostCategory'  -timeout 360m

=== NAME  TestAccCECostAllocationTag_disappears
    cost_allocation_tag_test.go:74: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCECostAllocationTag_disappears (0.74s)
=== NAME  TestAccCECostAllocationTag_basic
    cost_allocation_tag_test.go:27: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCECostAllocationTag_basic (0.74s)
=== NAME  TestAccCECostCategory_splitCharge
    cost_category_test.go:191: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCECostCategory_splitCharge (0.75s)
=== NAME  TestAccCECostCategory_tags
    cost_category_test.go:226: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCECostCategory_tags (0.76s)
=== NAME  TestAccCECostCategoryDataSource_basic
    cost_category_data_source_test.go:24: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCECostCategoryDataSource_basic (0.77s)
=== NAME  TestAccCECostCategory_notWithAnd
    cost_category_test.go:163: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCECostCategory_notWithAnd (0.77s)
=== NAME  TestAccCECostCategory_disappears
    cost_category_test.go:104: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCECostCategory_disappears (0.77s)
=== NAME  TestAccCECostCategory_effectiveStart
    cost_category_test.go:67: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCECostCategory_effectiveStart (0.77s)
=== NAME  TestAccCECostCategory_basic
    cost_category_test.go:31: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCECostCategory_basic (0.77s)
=== NAME  TestAccCECostCategory_complete
    cost_category_test.go:128: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCECostCategory_complete (0.79s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/ce 6.779s

@jar-b
Copy link
Member

jar-b commented Jul 29, 2024

Thanks for the quick fix, @acwwat! 👍

@jar-b jar-b merged commit 9d23db3 into hashicorp:main Jul 29, 2024
33 checks passed
@github-actions github-actions bot added this to the v5.61.0 milestone Jul 29, 2024
@justinretzolk justinretzolk added the external-maintainer Contribution from a trusted external contributor. label Jul 29, 2024
@acwwat acwwat deleted the td-aws_ce-add_payer_precheck branch July 30, 2024 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external-maintainer Contribution from a trusted external contributor. service/ce Issues and PRs that pertain to the ce service. size/S Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TechDebt]: Add PreCheck step to CostExplorer acceptance tests
3 participants