Skip to content

Add support for the wait_for_completed flag to aap_job resource #65

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

Merged
merged 1 commit into from
May 22, 2025

Conversation

fincamd
Copy link
Contributor

@fincamd fincamd commented May 8, 2025

Letting the user wait on aap_job resources to complete before continuing creating aap resources. Extra parameters allow the user to tweak the timeout of this wait operation

Copy link
Contributor

@arrestle arrestle left a comment

Choose a reason for hiding this comment

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

Great job overall! I agree with @PabloHiro regardng moving the waitForJob function and the async/await issue. I added a few small documentation requests as well.

Copy link
Collaborator

@dleehr dleehr left a comment

Choose a reason for hiding this comment

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

Looks like we're off to a great start @fincamd! This is great. I pointed out a couple things around the retry logic that I think we should explore, and @PabloHiro has some great feedback too.

@fincamd fincamd force-pushed the feat-waitforjobcompleted-aapjob branch from f4148bd to 2d9a0c3 Compare May 13, 2025 15:40
@fincamd fincamd requested review from PabloHiro, arrestle and dleehr May 13, 2025 16:00
@fincamd fincamd force-pushed the feat-waitforjobcompleted-aapjob branch from 2d9a0c3 to a7468c6 Compare May 14, 2025 06:35
@fincamd
Copy link
Contributor Author

fincamd commented May 14, 2025

All suggestions from previous reviews have been added to the proposed changes. The linter is complaining (I think) about code duplication. It doesn't make sense to me to refactor the duplication out since we require a lot of variables from the context... What should I do? Any recommendations here?

@PabloHiro
Copy link
Contributor

All suggestions from previous reviews have been added to the proposed changes. The linter is complaining (I think) about code duplication. It doesn't make sense to me to refactor the duplication out since we require a lot of variables from the context... What should I do? Any recommendations here?

Create a new function that takes data and resp as arguments, there is no other way I think. Again, do not inline this function as we will need it for inventory synching, project updates, etc

@fincamd
Copy link
Contributor Author

fincamd commented May 14, 2025

Create a new function that takes data and resp as arguments, there is no other way I think. Again, do not inline this function as we will need it for inventory synching, project updates, etc

To me that sounds like calling the Create() function from the Update() one. They share the same code, and even though it doesn't sit well with me, I can't find a good name for the refactored function other than CreateOrUpdate

I think for now we can leave it as it is and figure out a refactor later?

@lranjbar
Copy link
Contributor

As far as the linter complaining about duplication... we should ignore that for now. I have a set of changes that refactor to remove the boilerplate stuff. I also turned it off in my other PR because it complains about duplication and is unhelpful.

@lranjbar
Copy link
Contributor

Create a new function that takes data and resp as arguments, there is no other way I think. Again, do not inline this function as we will need it for inventory synching, project updates, etc

To me that sounds like calling the Create() function from the Update() one. They share the same code, and even though it doesn't sit well with me, I can't find a good name for the refactored function other than CreateOrUpdate

I think for now we can leave it as it is and figure out a refactor later?

Unfortunately I don't think we can change Create() and Update() functions because these are part of the Terraform framework. However, I believe Terraform will handle the concept of CreateOrUpdate for us.

Take a look at this diagram:
https://github.com/hashicorp/terraform/blob/main/docs/resource-instance-change-lifecycle.md

@lranjbar
Copy link
Contributor

@fincamd As far as any changes you need. At the moment this PR needs a rebase.

@fincamd fincamd force-pushed the feat-waitforjobcompleted-aapjob branch 2 times, most recently from 86b9b4e to 8377d5d Compare May 20, 2025 15:24
Letting the user wait on aap_job resources to complete before continuing
creating aap resources. Extra parameters allow the user to tweak the
timeout and poll interval of this wait operation
@fincamd fincamd force-pushed the feat-waitforjobcompleted-aapjob branch from 8377d5d to 04b37a7 Compare May 20, 2025 15:26
@fincamd
Copy link
Contributor Author

fincamd commented May 20, 2025

Thanks to the latest changes by @arrestle, the linter now likes my code :) my formatter locally wasn't applying the same spacing for some reason

Copy link
Contributor

@lranjbar lranjbar left a comment

Choose a reason for hiding this comment

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

lgtm!

Copy link
Collaborator

@dleehr dleehr left a comment

Choose a reason for hiding this comment

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

Looks good. I left a comment about updating the acceptance tests, and as discussed last week, this can come in a follow-up PR.

One thing I request is the output of running the acceptance tests, since CI is unable to do that.

@fincamd
Copy link
Contributor Author

fincamd commented May 21, 2025

Here are the current (but failing) results of the acceptance tests run

==> Running acceptance tests...
TF_ACC=1 go test -count=1 -v ./...
?   	github.com/ansible/terraform-provider-aap	[no test files]
=== RUN   TestComputeURLPath
=== RUN   TestComputeURLPath/case_1
=== RUN   TestComputeURLPath/case_2
=== RUN   TestComputeURLPath/case_3
=== RUN   TestComputeURLPath/case_4
--- PASS: TestComputeURLPath (0.00s)
    --- PASS: TestComputeURLPath/case_1 (0.00s)
    --- PASS: TestComputeURLPath/case_2 (0.00s)
    --- PASS: TestComputeURLPath/case_3 (0.00s)
    --- PASS: TestComputeURLPath/case_4 (0.00s)
=== RUN   TestReadApiEndpoint
=== RUN   TestReadApiEndpoint/AAP_2.4
=== RUN   TestReadApiEndpoint/AAP_2.5+
--- PASS: TestReadApiEndpoint (0.00s)
    --- PASS: TestReadApiEndpoint/AAP_2.4 (0.00s)
    --- PASS: TestReadApiEndpoint/AAP_2.5+ (0.00s)
=== RUN   TestGroupResourceSchema
=== PAUSE TestGroupResourceSchema
=== RUN   TestGroupResourceCreateRequestBody
=== RUN   TestGroupResourceCreateRequestBody/test_with_unknown_values
=== RUN   TestGroupResourceCreateRequestBody/test_with_null_values
=== RUN   TestGroupResourceCreateRequestBody/test_with_some_values
=== RUN   TestGroupResourceCreateRequestBody/test_with_all_values
--- PASS: TestGroupResourceCreateRequestBody (0.00s)
    --- PASS: TestGroupResourceCreateRequestBody/test_with_unknown_values (0.00s)
    --- PASS: TestGroupResourceCreateRequestBody/test_with_null_values (0.00s)
    --- PASS: TestGroupResourceCreateRequestBody/test_with_some_values (0.00s)
    --- PASS: TestGroupResourceCreateRequestBody/test_with_all_values (0.00s)
=== RUN   TestGroupResourceParseHttpResponse
=== RUN   TestGroupResourceParseHttpResponse/test_with_JSON_error
=== RUN   TestGroupResourceParseHttpResponse/test_with_missing_values
=== RUN   TestGroupResourceParseHttpResponse/test_with_all_values
--- PASS: TestGroupResourceParseHttpResponse (0.00s)
    --- PASS: TestGroupResourceParseHttpResponse/test_with_JSON_error (0.00s)
    --- PASS: TestGroupResourceParseHttpResponse/test_with_missing_values (0.00s)
    --- PASS: TestGroupResourceParseHttpResponse/test_with_all_values (0.00s)
=== RUN   TestAccGroupResource
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0xe3c1e0]

goroutine 150 [running]:
github.com/ansible/terraform-provider-aap/internal/provider.(*AAPClient).GetWithStatus(0x2f0000c0000511d8?, {0x114044b?, 0x41e991?})
	/home/dfinca/ansible/terraform-provider-aap/internal/provider/client.go:155 +0xa0
github.com/ansible/terraform-provider-aap/internal/provider.(*AAPClient).Get(0x6b2b00?, {0x114044b?, 0x0?})
	/home/dfinca/ansible/terraform-provider-aap/internal/provider/client.go:159 +0x18
github.com/ansible/terraform-provider-aap/internal/provider.readApiEndpoint({0x1308cb8, 0xc00024dc80})
	/home/dfinca/ansible/terraform-provider-aap/internal/provider/client.go:45 +0x42
github.com/ansible/terraform-provider-aap/internal/provider.(*AAPClient).setApiEndpoint(0xc00024dc80)
	/home/dfinca/ansible/terraform-provider-aap/internal/provider/client.go:100 +0x26
github.com/ansible/terraform-provider-aap/internal/provider.NewClient({0xc0003ca149?, 0xc000051438?}, 0xc00060e810, 0xc00060e820, 0x1, 0x5)
	/home/dfinca/ansible/terraform-provider-aap/internal/provider/client.go:95 +0x1c5
github.com/ansible/terraform-provider-aap/internal/provider.(*aapProvider).Configure(0xc000247e90?, {0x1302a80, 0xc000295d70}, {{0xc000248410, 0x6}, {{{0x13092f8, 0xc000247ef0}, {0xff5f60, 0xc000247e90}}, {0x130b5c8, ...}}, ...}, ...)
	/home/dfinca/ansible/terraform-provider-aap/internal/provider/provider.go:135 +0x390
github.com/hashicorp/terraform-plugin-framework/internal/fwserver.(*Server).ConfigureProvider(0xc00021cb48, {0x1302a80, 0xc000295d70}, 0xc000242ff0, 0xc000242fa0)
	/home/dfinca/go/bin/pkg/mod/github.com/hashicorp/[email protected]/internal/fwserver/server_configureprovider.go:18 +0x131
github.com/hashicorp/terraform-plugin-framework/internal/proto6server.(*Server).ConfigureProvider(0xc00021cb48, {0x1302a80?, 0xc000295cb0?}, 0xc0003a2800)
	/home/dfinca/go/bin/pkg/mod/github.com/hashicorp/[email protected]/internal/proto6server/server_configureprovider.go:39 +0x29f
github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server.(*server).ConfigureProvider(0xc0004286e0, {0x1302a80?, 0xc000295080?}, 0xc000242cd0)
	/home/dfinca/go/bin/pkg/mod/github.com/hashicorp/[email protected]/tfprotov6/tf6server/server.go:559 +0x33e
github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6._Provider_ConfigureProvider_Handler({0x111a040, 0xc0004286e0}, {0x1302a80, 0xc000295080}, 0xc00035ae00, 0x0)
	/home/dfinca/go/bin/pkg/mod/github.com/hashicorp/[email protected]/tfprotov6/internal/tfplugin6/tfplugin6_grpc.pb.go:557 +0x1a6
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0002da400, {0x1302a80, 0xc000295020}, 0xc00015b020, 0xc000405710, 0x1ad3d70, 0x0)
	/home/dfinca/go/bin/pkg/mod/google.golang.org/[email protected]/server.go:1392 +0xfbe
google.golang.org/grpc.(*Server).handleStream(0xc0002da400, {0x1303968, 0xc00050c000}, 0xc00015b020)
	/home/dfinca/go/bin/pkg/mod/google.golang.org/[email protected]/server.go:1802 +0xb88
google.golang.org/grpc.(*Server).serveStreams.func2.1()
	/home/dfinca/go/bin/pkg/mod/google.golang.org/[email protected]/server.go:1030 +0x7f
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 164
	/home/dfinca/go/bin/pkg/mod/google.golang.org/[email protected]/server.go:1041 +0x11d
FAIL	github.com/ansible/terraform-provider-aap/internal/provider	0.094s
=== RUN   TestAAPCustomStringTypeValidate
=== PAUSE TestAAPCustomStringTypeValidate
=== RUN   TestAAPCustomStringTypeValueFromTerraform
=== PAUSE TestAAPCustomStringTypeValueFromTerraform
=== RUN   TestAAPCustomStringStringSemanticEquals
=== PAUSE TestAAPCustomStringStringSemanticEquals
=== CONT  TestAAPCustomStringTypeValidate
=== CONT  TestAAPCustomStringStringSemanticEquals
=== RUN   TestAAPCustomStringTypeValidate/empty-struct
=== PAUSE TestAAPCustomStringTypeValidate/empty-struct
=== RUN   TestAAPCustomStringStringSemanticEquals/not_equal_-_mismatched_field_names
=== CONT  TestAAPCustomStringTypeValueFromTerraform
=== PAUSE TestAAPCustomStringStringSemanticEquals/not_equal_-_mismatched_field_names
=== RUN   TestAAPCustomStringTypeValueFromTerraform/yaml_string_no_newline
=== PAUSE TestAAPCustomStringTypeValueFromTerraform/yaml_string_no_newline
=== RUN   TestAAPCustomStringStringSemanticEquals/not_equal_-_additional_field
=== PAUSE TestAAPCustomStringStringSemanticEquals/not_equal_-_additional_field
=== RUN   TestAAPCustomStringStringSemanticEquals/not_equal_-_array_item_order_difference
=== PAUSE TestAAPCustomStringStringSemanticEquals/not_equal_-_array_item_order_difference
=== RUN   TestAAPCustomStringStringSemanticEquals/semantically_equal_-_object_byte-for-byte_match
=== PAUSE TestAAPCustomStringStringSemanticEquals/semantically_equal_-_object_byte-for-byte_match
=== RUN   TestAAPCustomStringStringSemanticEquals/semantically_equal_-_object_whitespace_difference
=== PAUSE TestAAPCustomStringStringSemanticEquals/semantically_equal_-_object_whitespace_difference
=== RUN   TestAAPCustomStringStringSemanticEquals/semantically_equal_-_yaml_no_difference
=== PAUSE TestAAPCustomStringStringSemanticEquals/semantically_equal_-_yaml_no_difference
=== RUN   TestAAPCustomStringTypeValidate/null
=== RUN   TestAAPCustomStringTypeValueFromTerraform/true
=== PAUSE TestAAPCustomStringTypeValidate/null
=== PAUSE TestAAPCustomStringTypeValueFromTerraform/true
=== RUN   TestAAPCustomStringStringSemanticEquals/semantically_equal_-_yaml_no_difference_with_newline
=== RUN   TestAAPCustomStringTypeValidate/unknown
=== PAUSE TestAAPCustomStringStringSemanticEquals/semantically_equal_-_yaml_no_difference_with_newline
=== PAUSE TestAAPCustomStringTypeValidate/unknown
=== RUN   TestAAPCustomStringStringSemanticEquals/not_equal_-_mismatched_field_values
=== PAUSE TestAAPCustomStringStringSemanticEquals/not_equal_-_mismatched_field_values
=== RUN   TestAAPCustomStringTypeValidate/json_object
=== CONT  TestAAPCustomStringStringSemanticEquals/not_equal_-_mismatched_field_names
=== PAUSE TestAAPCustomStringTypeValidate/json_object
=== RUN   TestAAPCustomStringTypeValidate/json_string
=== PAUSE TestAAPCustomStringTypeValidate/json_string
=== RUN   TestAAPCustomStringTypeValidate/yaml_string
=== PAUSE TestAAPCustomStringTypeValidate/yaml_string
=== CONT  TestAAPCustomStringStringSemanticEquals/semantically_equal_-_yaml_no_difference
=== RUN   TestAAPCustomStringTypeValidate/yaml_string_no_newline
=== PAUSE TestAAPCustomStringTypeValidate/yaml_string_no_newline
=== RUN   TestAAPCustomStringTypeValidate/wrong-value-type
=== CONT  TestAAPCustomStringStringSemanticEquals/semantically_equal_-_yaml_no_difference_with_newline
=== PAUSE TestAAPCustomStringTypeValidate/wrong-value-type
=== CONT  TestAAPCustomStringTypeValidate/empty-struct
=== CONT  TestAAPCustomStringStringSemanticEquals/semantically_equal_-_object_byte-for-byte_match
=== CONT  TestAAPCustomStringTypeValidate/wrong-value-type
=== CONT  TestAAPCustomStringStringSemanticEquals/semantically_equal_-_object_whitespace_difference
=== CONT  TestAAPCustomStringStringSemanticEquals/not_equal_-_mismatched_field_values
=== CONT  TestAAPCustomStringStringSemanticEquals/not_equal_-_array_item_order_difference
=== CONT  TestAAPCustomStringTypeValidate/null
=== RUN   TestAAPCustomStringTypeValueFromTerraform/unknown
=== PAUSE TestAAPCustomStringTypeValueFromTerraform/unknown
=== CONT  TestAAPCustomStringTypeValidate/unknown
=== CONT  TestAAPCustomStringTypeValidate/json_object
=== RUN   TestAAPCustomStringTypeValueFromTerraform/null
=== CONT  TestAAPCustomStringTypeValidate/json_string
=== PAUSE TestAAPCustomStringTypeValueFromTerraform/null
=== CONT  TestAAPCustomStringTypeValidate/yaml_string
=== RUN   TestAAPCustomStringTypeValueFromTerraform/wrongType
=== CONT  TestAAPCustomStringStringSemanticEquals/not_equal_-_additional_field
=== PAUSE TestAAPCustomStringTypeValueFromTerraform/wrongType
=== CONT  TestAAPCustomStringTypeValueFromTerraform/yaml_string_no_newline
=== CONT  TestAAPCustomStringTypeValueFromTerraform/null
=== CONT  TestAAPCustomStringTypeValueFromTerraform/wrongType
--- PASS: TestAAPCustomStringStringSemanticEquals (0.00s)
    --- PASS: TestAAPCustomStringStringSemanticEquals/not_equal_-_mismatched_field_names (0.00s)
    --- PASS: TestAAPCustomStringStringSemanticEquals/semantically_equal_-_object_whitespace_difference (0.00s)
    --- PASS: TestAAPCustomStringStringSemanticEquals/not_equal_-_mismatched_field_values (0.00s)
    --- PASS: TestAAPCustomStringStringSemanticEquals/not_equal_-_array_item_order_difference (0.00s)
    --- PASS: TestAAPCustomStringStringSemanticEquals/semantically_equal_-_yaml_no_difference (0.00s)
    --- PASS: TestAAPCustomStringStringSemanticEquals/semantically_equal_-_yaml_no_difference_with_newline (0.00s)
    --- PASS: TestAAPCustomStringStringSemanticEquals/semantically_equal_-_object_byte-for-byte_match (0.00s)
    --- PASS: TestAAPCustomStringStringSemanticEquals/not_equal_-_additional_field (0.00s)
=== CONT  TestAAPCustomStringTypeValueFromTerraform/unknown
=== CONT  TestAAPCustomStringTypeValueFromTerraform/true
--- PASS: TestAAPCustomStringTypeValueFromTerraform (0.00s)
    --- PASS: TestAAPCustomStringTypeValueFromTerraform/yaml_string_no_newline (0.00s)
    --- PASS: TestAAPCustomStringTypeValueFromTerraform/null (0.00s)
    --- PASS: TestAAPCustomStringTypeValueFromTerraform/unknown (0.00s)
    --- PASS: TestAAPCustomStringTypeValueFromTerraform/wrongType (0.00s)
    --- PASS: TestAAPCustomStringTypeValueFromTerraform/true (0.00s)
=== CONT  TestAAPCustomStringTypeValidate/yaml_string_no_newline
--- PASS: TestAAPCustomStringTypeValidate (0.00s)
    --- PASS: TestAAPCustomStringTypeValidate/wrong-value-type (0.00s)
    --- PASS: TestAAPCustomStringTypeValidate/null (0.00s)
    --- PASS: TestAAPCustomStringTypeValidate/json_object (0.00s)
    --- PASS: TestAAPCustomStringTypeValidate/unknown (0.00s)
    --- PASS: TestAAPCustomStringTypeValidate/empty-struct (0.00s)
    --- PASS: TestAAPCustomStringTypeValidate/yaml_string (0.00s)
    --- PASS: TestAAPCustomStringTypeValidate/json_string (0.00s)
    --- PASS: TestAAPCustomStringTypeValidate/yaml_string_no_newline (0.00s)
PASS
ok  	github.com/ansible/terraform-provider-aap/internal/provider/customtypes	0.002s
FAIL

@fincamd
Copy link
Contributor Author

fincamd commented May 22, 2025

Latest errors from the acceptance tests.
I was able to get them to run after increasing the amount of memory set for podman in my machine.

It's not yet 100% green on my end. I'll get back to this on Monday. But the PR is ready to be merged.

==> Running acceptance tests...
TF_ACC=1 go test -count=1 -v ./...
?   	github.com/ansible/terraform-provider-aap	[no test files]
=== RUN   TestComputeURLPath
=== RUN   TestComputeURLPath/case_1
=== RUN   TestComputeURLPath/case_2
=== RUN   TestComputeURLPath/case_3
=== RUN   TestComputeURLPath/case_4
--- PASS: TestComputeURLPath (0.00s)
    --- PASS: TestComputeURLPath/case_1 (0.00s)
    --- PASS: TestComputeURLPath/case_2 (0.00s)
    --- PASS: TestComputeURLPath/case_3 (0.00s)
    --- PASS: TestComputeURLPath/case_4 (0.00s)
=== RUN   TestReadApiEndpoint
=== RUN   TestReadApiEndpoint/AAP_2.4
=== RUN   TestReadApiEndpoint/AAP_2.5+
--- PASS: TestReadApiEndpoint (0.00s)
    --- PASS: TestReadApiEndpoint/AAP_2.4 (0.00s)
    --- PASS: TestReadApiEndpoint/AAP_2.5+ (0.00s)
=== RUN   TestGroupResourceSchema
=== PAUSE TestGroupResourceSchema
=== RUN   TestGroupResourceCreateRequestBody
=== RUN   TestGroupResourceCreateRequestBody/test_with_unknown_values
=== RUN   TestGroupResourceCreateRequestBody/test_with_null_values
=== RUN   TestGroupResourceCreateRequestBody/test_with_some_values
=== RUN   TestGroupResourceCreateRequestBody/test_with_all_values
--- PASS: TestGroupResourceCreateRequestBody (0.00s)
    --- PASS: TestGroupResourceCreateRequestBody/test_with_unknown_values (0.00s)
    --- PASS: TestGroupResourceCreateRequestBody/test_with_null_values (0.00s)
    --- PASS: TestGroupResourceCreateRequestBody/test_with_some_values (0.00s)
    --- PASS: TestGroupResourceCreateRequestBody/test_with_all_values (0.00s)
=== RUN   TestGroupResourceParseHttpResponse
=== RUN   TestGroupResourceParseHttpResponse/test_with_JSON_error
=== RUN   TestGroupResourceParseHttpResponse/test_with_missing_values
=== RUN   TestGroupResourceParseHttpResponse/test_with_all_values
--- PASS: TestGroupResourceParseHttpResponse (0.00s)
    --- PASS: TestGroupResourceParseHttpResponse/test_with_JSON_error (0.00s)
    --- PASS: TestGroupResourceParseHttpResponse/test_with_missing_values (0.00s)
    --- PASS: TestGroupResourceParseHttpResponse/test_with_all_values (0.00s)
=== RUN   TestAccGroupResource
--- PASS: TestAccGroupResource (14.19s)
=== RUN   TestSliceDifference
--- PASS: TestSliceDifference (0.00s)
=== RUN   TestExtractIDs
--- PASS: TestExtractIDs (0.00s)
=== RUN   TestHostResourceSchema
=== PAUSE TestHostResourceSchema
=== RUN   TestHostResourceCreateRequestBody
=== RUN   TestHostResourceCreateRequestBody/test_with_unknown_values
=== RUN   TestHostResourceCreateRequestBody/test_with_null_values
=== RUN   TestHostResourceCreateRequestBody/test_with_some_values
=== RUN   TestHostResourceCreateRequestBody/test_with_all_values
--- PASS: TestHostResourceCreateRequestBody (0.00s)
    --- PASS: TestHostResourceCreateRequestBody/test_with_unknown_values (0.00s)
    --- PASS: TestHostResourceCreateRequestBody/test_with_null_values (0.00s)
    --- PASS: TestHostResourceCreateRequestBody/test_with_some_values (0.00s)
    --- PASS: TestHostResourceCreateRequestBody/test_with_all_values (0.00s)
=== RUN   TestHostResourceParseHttpResponse
=== RUN   TestHostResourceParseHttpResponse/test_with_JSON_error
=== RUN   TestHostResourceParseHttpResponse/test_with_missing_values
=== RUN   TestHostResourceParseHttpResponse/test_with_all_values
--- PASS: TestHostResourceParseHttpResponse (0.00s)
    --- PASS: TestHostResourceParseHttpResponse/test_with_JSON_error (0.00s)
    --- PASS: TestHostResourceParseHttpResponse/test_with_missing_values (0.00s)
    --- PASS: TestHostResourceParseHttpResponse/test_with_all_values (0.00s)
=== RUN   TestAccHostResource
--- PASS: TestAccHostResource (17.31s)
=== RUN   TestInventoryDataSourceSchema
=== PAUSE TestInventoryDataSourceSchema
=== RUN   TestInventoryDataSourceParseHttpResponse
=== RUN   TestInventoryDataSourceParseHttpResponse/JSON_error
=== RUN   TestInventoryDataSourceParseHttpResponse/missing_values
=== RUN   TestInventoryDataSourceParseHttpResponse/all_values
--- PASS: TestInventoryDataSourceParseHttpResponse (0.00s)
    --- PASS: TestInventoryDataSourceParseHttpResponse/JSON_error (0.00s)
    --- PASS: TestInventoryDataSourceParseHttpResponse/missing_values (0.00s)
    --- PASS: TestInventoryDataSourceParseHttpResponse/all_values (0.00s)
=== RUN   TestAccInventoryDataSource
--- PASS: TestAccInventoryDataSource (5.98s)
=== RUN   TestInventoryResourceSchema
=== PAUSE TestInventoryResourceSchema
=== RUN   TestInventoryResourceGenerateRequestBody
=== RUN   TestInventoryResourceGenerateRequestBody/unknown_values
=== RUN   TestInventoryResourceGenerateRequestBody/null_values
=== RUN   TestInventoryResourceGenerateRequestBody/provided_values
--- PASS: TestInventoryResourceGenerateRequestBody (0.00s)
    --- PASS: TestInventoryResourceGenerateRequestBody/unknown_values (0.00s)
    --- PASS: TestInventoryResourceGenerateRequestBody/null_values (0.00s)
    --- PASS: TestInventoryResourceGenerateRequestBody/provided_values (0.00s)
=== RUN   TestInventoryResourceParseHttpResponse
=== RUN   TestInventoryResourceParseHttpResponse/JSON_error
=== RUN   TestInventoryResourceParseHttpResponse/missing_values
=== RUN   TestInventoryResourceParseHttpResponse/all_values
--- PASS: TestInventoryResourceParseHttpResponse (0.00s)
    --- PASS: TestInventoryResourceParseHttpResponse/JSON_error (0.00s)
    --- PASS: TestInventoryResourceParseHttpResponse/missing_values (0.00s)
    --- PASS: TestInventoryResourceParseHttpResponse/all_values (0.00s)
=== RUN   TestAccInventoryResource
--- PASS: TestAccInventoryResource (13.18s)
=== RUN   TestJobResourceSchema
=== PAUSE TestJobResourceSchema
=== RUN   TestJobResourceCreateRequestBody
=== RUN   TestJobResourceCreateRequestBody/unknown_values
=== RUN   TestJobResourceCreateRequestBody/null_values
=== RUN   TestJobResourceCreateRequestBody/extra_vars_only
=== RUN   TestJobResourceCreateRequestBody/inventory_vars_only
=== RUN   TestJobResourceCreateRequestBody/combined
=== RUN   TestJobResourceCreateRequestBody/manual_triggers
=== RUN   TestJobResourceCreateRequestBody/wait_for_completed_parameters
--- PASS: TestJobResourceCreateRequestBody (0.00s)
    --- PASS: TestJobResourceCreateRequestBody/unknown_values (0.00s)
    --- PASS: TestJobResourceCreateRequestBody/null_values (0.00s)
    --- PASS: TestJobResourceCreateRequestBody/extra_vars_only (0.00s)
    --- PASS: TestJobResourceCreateRequestBody/inventory_vars_only (0.00s)
    --- PASS: TestJobResourceCreateRequestBody/combined (0.00s)
    --- PASS: TestJobResourceCreateRequestBody/manual_triggers (0.00s)
    --- PASS: TestJobResourceCreateRequestBody/wait_for_completed_parameters (0.00s)
=== RUN   TestJobResourceParseHttpResponse
=== RUN   TestJobResourceParseHttpResponse/JSON_error
=== RUN   TestJobResourceParseHttpResponse/no_ignored_fields
=== RUN   TestJobResourceParseHttpResponse/ignored_fields
--- PASS: TestJobResourceParseHttpResponse (0.00s)
    --- PASS: TestJobResourceParseHttpResponse/JSON_error (0.00s)
    --- PASS: TestJobResourceParseHttpResponse/no_ignored_fields (0.00s)
    --- PASS: TestJobResourceParseHttpResponse/ignored_fields (0.00s)
=== RUN   TestAccAAPJob_basic
--- PASS: TestAccAAPJob_basic (6.50s)
=== RUN   TestAccAAPJob_UpdateWithSameParameters
--- PASS: TestAccAAPJob_UpdateWithSameParameters (8.60s)
=== RUN   TestAccAAPJob_UpdateWithNewInventoryIdPromptOnLaunch
    testing_new.go:91: Error running post-test destroy, there may be dangling resources: exit status 1
        
        Error: Unexpected HTTP status code received for DELETE request to path http://localhost:44925/api/controller/v2/inventories/7/
        
        Expected one of ([202 204]), got (409). Response details:
        map[active_jobs:[map[id:5 type:job]] error:Resource is being used by running
        jobs.]
--- FAIL: TestAccAAPJob_UpdateWithNewInventoryIdPromptOnLaunch (148.68s)
=== RUN   TestAccAAPJob_UpdateWithTrigger
--- PASS: TestAccAAPJob_UpdateWithTrigger (9.17s)
=== RUN   TestAccAAPJob_disappears
    job_resource_test.go:454: Step 3/4 error: Check failed: Check 1/2 error: Check 1/3 error: aap_job.test: Attribute 'status' didn't match "^(failed|complete|successful)$", got "pending"
        Check 2/2 error: [{Expected one of ([202 204]), got (403). Response details: map[detail:Cannot delete running job resource.] Unexpected HTTP status code received for DELETE request to path http://localhost:44925/api/controller/v2/jobs/9/}]
--- FAIL: TestAccAAPJob_disappears (148.88s)
=== RUN   TestReadValues
=== RUN   TestReadValues/No_defined_values
=== RUN   TestReadValues/Using_env_variables_only
=== RUN   TestReadValues/Using_both_configuration_and_envs_value
=== RUN   TestReadValues/Using_configuration_value
=== RUN   TestReadValues/Bad_value_for_env_variable
=== RUN   TestReadValues/Using_null_values_in_configuration
--- PASS: TestReadValues (0.00s)
    --- PASS: TestReadValues/No_defined_values (0.00s)
    --- PASS: TestReadValues/Using_env_variables_only (0.00s)
    --- PASS: TestReadValues/Using_both_configuration_and_envs_value (0.00s)
    --- PASS: TestReadValues/Using_configuration_value (0.00s)
    --- PASS: TestReadValues/Bad_value_for_env_variable (0.00s)
    --- PASS: TestReadValues/Using_null_values_in_configuration (0.00s)
=== RUN   TestReturnAAPNamedURL
=== RUN   TestReturnAAPNamedURL/test_test
=== RUN   TestReturnAAPNamedURL/test_test#01
=== RUN   TestReturnAAPNamedURL/test_test#02
=== RUN   TestReturnAAPNamedURL/test_test#03
=== RUN   TestReturnAAPNamedURL/test_test#04
=== RUN   TestReturnAAPNamedURL/test_test#05
=== RUN   TestReturnAAPNamedURL/test_test#06
=== RUN   TestReturnAAPNamedURL/test_test#07
=== RUN   TestReturnAAPNamedURL/test_test#08
=== RUN   TestReturnAAPNamedURL/test_test#09
--- PASS: TestReturnAAPNamedURL (0.00s)
    --- PASS: TestReturnAAPNamedURL/test_test (0.00s)
    --- PASS: TestReturnAAPNamedURL/test_test#01 (0.00s)
    --- PASS: TestReturnAAPNamedURL/test_test#02 (0.00s)
    --- PASS: TestReturnAAPNamedURL/test_test#03 (0.00s)
    --- PASS: TestReturnAAPNamedURL/test_test#04 (0.00s)
    --- PASS: TestReturnAAPNamedURL/test_test#05 (0.00s)
    --- PASS: TestReturnAAPNamedURL/test_test#06 (0.00s)
    --- PASS: TestReturnAAPNamedURL/test_test#07 (0.00s)
    --- PASS: TestReturnAAPNamedURL/test_test#08 (0.00s)
    --- PASS: TestReturnAAPNamedURL/test_test#09 (0.00s)
=== RUN   TestGetURL
=== RUN   TestGetURL/https://example.com
=== RUN   TestGetURL/https://example.com/
=== RUN   TestGetURL/https://example.com#01
=== RUN   TestGetURL/invalid-url
--- PASS: TestGetURL (0.00s)
    --- PASS: TestGetURL/https://example.com (0.00s)
    --- PASS: TestGetURL/https://example.com/ (0.00s)
    --- PASS: TestGetURL/https://example.com#01 (0.00s)
    --- PASS: TestGetURL/invalid-url (0.00s)
=== RUN   TestParseStringValue
=== RUN   TestParseStringValue/Test_non-empty_string
=== RUN   TestParseStringValue/Test_empty_string
--- PASS: TestParseStringValue (0.00s)
    --- PASS: TestParseStringValue/Test_non-empty_string (0.00s)
    --- PASS: TestParseStringValue/Test_empty_string (0.00s)
=== RUN   TestParseNormalizedValue
=== RUN   TestParseNormalizedValue/Test_non-empty_string
=== RUN   TestParseNormalizedValue/Test_empty_string
--- PASS: TestParseNormalizedValue (0.00s)
    --- PASS: TestParseNormalizedValue/Test_non-empty_string (0.00s)
    --- PASS: TestParseNormalizedValue/Test_empty_string (0.00s)
=== CONT  TestGroupResourceSchema
=== CONT  TestJobResourceSchema
=== CONT  TestInventoryDataSourceSchema
=== CONT  TestHostResourceSchema
--- PASS: TestGroupResourceSchema (0.00s)
=== CONT  TestInventoryResourceSchema
--- PASS: TestHostResourceSchema (0.00s)
--- PASS: TestJobResourceSchema (0.00s)
--- PASS: TestInventoryDataSourceSchema (0.00s)
--- PASS: TestInventoryResourceSchema (0.00s)
FAIL
FAIL	github.com/ansible/terraform-provider-aap/internal/provider	372.507s
=== RUN   TestAAPCustomStringTypeValidate
=== PAUSE TestAAPCustomStringTypeValidate
=== RUN   TestAAPCustomStringTypeValueFromTerraform
=== PAUSE TestAAPCustomStringTypeValueFromTerraform
=== RUN   TestAAPCustomStringStringSemanticEquals
=== PAUSE TestAAPCustomStringStringSemanticEquals
=== CONT  TestAAPCustomStringTypeValidate
=== CONT  TestAAPCustomStringStringSemanticEquals
=== RUN   TestAAPCustomStringTypeValidate/yaml_string
=== PAUSE TestAAPCustomStringTypeValidate/yaml_string
=== RUN   TestAAPCustomStringStringSemanticEquals/semantically_equal_-_yaml_no_difference
=== RUN   TestAAPCustomStringTypeValidate/yaml_string_no_newline
=== PAUSE TestAAPCustomStringTypeValidate/yaml_string_no_newline
=== PAUSE TestAAPCustomStringStringSemanticEquals/semantically_equal_-_yaml_no_difference
=== RUN   TestAAPCustomStringTypeValidate/wrong-value-type
=== PAUSE TestAAPCustomStringTypeValidate/wrong-value-type
=== CONT  TestAAPCustomStringTypeValueFromTerraform
=== RUN   TestAAPCustomStringTypeValueFromTerraform/true
=== PAUSE TestAAPCustomStringTypeValueFromTerraform/true
=== RUN   TestAAPCustomStringTypeValidate/empty-struct
=== RUN   TestAAPCustomStringStringSemanticEquals/semantically_equal_-_yaml_no_difference_with_newline
=== PAUSE TestAAPCustomStringStringSemanticEquals/semantically_equal_-_yaml_no_difference_with_newline
=== RUN   TestAAPCustomStringStringSemanticEquals/not_equal_-_mismatched_field_values
=== PAUSE TestAAPCustomStringStringSemanticEquals/not_equal_-_mismatched_field_values
=== RUN   TestAAPCustomStringStringSemanticEquals/not_equal_-_mismatched_field_names
=== PAUSE TestAAPCustomStringStringSemanticEquals/not_equal_-_mismatched_field_names
=== RUN   TestAAPCustomStringTypeValueFromTerraform/unknown
=== RUN   TestAAPCustomStringStringSemanticEquals/not_equal_-_additional_field
=== PAUSE TestAAPCustomStringStringSemanticEquals/not_equal_-_additional_field
=== RUN   TestAAPCustomStringStringSemanticEquals/not_equal_-_array_item_order_difference
=== PAUSE TestAAPCustomStringStringSemanticEquals/not_equal_-_array_item_order_difference
=== RUN   TestAAPCustomStringStringSemanticEquals/semantically_equal_-_object_byte-for-byte_match
=== PAUSE TestAAPCustomStringStringSemanticEquals/semantically_equal_-_object_byte-for-byte_match
=== RUN   TestAAPCustomStringStringSemanticEquals/semantically_equal_-_object_whitespace_difference
=== PAUSE TestAAPCustomStringStringSemanticEquals/semantically_equal_-_object_whitespace_difference
=== CONT  TestAAPCustomStringStringSemanticEquals/semantically_equal_-_yaml_no_difference
=== CONT  TestAAPCustomStringStringSemanticEquals/not_equal_-_array_item_order_difference
=== CONT  TestAAPCustomStringStringSemanticEquals/semantically_equal_-_object_whitespace_difference
=== PAUSE TestAAPCustomStringTypeValidate/empty-struct
=== CONT  TestAAPCustomStringStringSemanticEquals/semantically_equal_-_object_byte-for-byte_match
=== PAUSE TestAAPCustomStringTypeValueFromTerraform/unknown
=== RUN   TestAAPCustomStringTypeValidate/null
=== RUN   TestAAPCustomStringTypeValueFromTerraform/null
=== PAUSE TestAAPCustomStringTypeValidate/null
=== PAUSE TestAAPCustomStringTypeValueFromTerraform/null
=== RUN   TestAAPCustomStringTypeValidate/unknown
=== RUN   TestAAPCustomStringTypeValueFromTerraform/wrongType
=== PAUSE TestAAPCustomStringTypeValidate/unknown
=== PAUSE TestAAPCustomStringTypeValueFromTerraform/wrongType
=== RUN   TestAAPCustomStringTypeValidate/json_object
=== CONT  TestAAPCustomStringStringSemanticEquals/not_equal_-_additional_field
=== CONT  TestAAPCustomStringStringSemanticEquals/not_equal_-_mismatched_field_values
=== CONT  TestAAPCustomStringStringSemanticEquals/not_equal_-_mismatched_field_names
=== PAUSE TestAAPCustomStringTypeValidate/json_object
=== RUN   TestAAPCustomStringTypeValidate/json_string
=== CONT  TestAAPCustomStringStringSemanticEquals/semantically_equal_-_yaml_no_difference_with_newline
--- PASS: TestAAPCustomStringStringSemanticEquals (0.00s)
    --- PASS: TestAAPCustomStringStringSemanticEquals/semantically_equal_-_yaml_no_difference (0.00s)
    --- PASS: TestAAPCustomStringStringSemanticEquals/not_equal_-_mismatched_field_values (0.00s)
    --- PASS: TestAAPCustomStringStringSemanticEquals/semantically_equal_-_object_whitespace_difference (0.00s)
    --- PASS: TestAAPCustomStringStringSemanticEquals/not_equal_-_mismatched_field_names (0.00s)
    --- PASS: TestAAPCustomStringStringSemanticEquals/not_equal_-_array_item_order_difference (0.00s)
    --- PASS: TestAAPCustomStringStringSemanticEquals/semantically_equal_-_object_byte-for-byte_match (0.00s)
    --- PASS: TestAAPCustomStringStringSemanticEquals/not_equal_-_additional_field (0.00s)
    --- PASS: TestAAPCustomStringStringSemanticEquals/semantically_equal_-_yaml_no_difference_with_newline (0.00s)
=== PAUSE TestAAPCustomStringTypeValidate/json_string
=== CONT  TestAAPCustomStringTypeValidate/yaml_string
=== CONT  TestAAPCustomStringTypeValidate/unknown
=== CONT  TestAAPCustomStringTypeValidate/json_string
=== RUN   TestAAPCustomStringTypeValueFromTerraform/yaml_string_no_newline
=== CONT  TestAAPCustomStringTypeValidate/wrong-value-type
=== PAUSE TestAAPCustomStringTypeValueFromTerraform/yaml_string_no_newline
=== CONT  TestAAPCustomStringTypeValidate/yaml_string_no_newline
=== CONT  TestAAPCustomStringTypeValueFromTerraform/true
=== CONT  TestAAPCustomStringTypeValueFromTerraform/yaml_string_no_newline
=== CONT  TestAAPCustomStringTypeValueFromTerraform/wrongType
=== CONT  TestAAPCustomStringTypeValueFromTerraform/null
=== CONT  TestAAPCustomStringTypeValueFromTerraform/unknown
=== CONT  TestAAPCustomStringTypeValidate/null
--- PASS: TestAAPCustomStringTypeValueFromTerraform (0.00s)
    --- PASS: TestAAPCustomStringTypeValueFromTerraform/true (0.00s)
    --- PASS: TestAAPCustomStringTypeValueFromTerraform/yaml_string_no_newline (0.00s)
    --- PASS: TestAAPCustomStringTypeValueFromTerraform/null (0.00s)
    --- PASS: TestAAPCustomStringTypeValueFromTerraform/unknown (0.00s)
    --- PASS: TestAAPCustomStringTypeValueFromTerraform/wrongType (0.00s)
=== CONT  TestAAPCustomStringTypeValidate/json_object
=== CONT  TestAAPCustomStringTypeValidate/empty-struct
--- PASS: TestAAPCustomStringTypeValidate (0.00s)
    --- PASS: TestAAPCustomStringTypeValidate/yaml_string (0.00s)
    --- PASS: TestAAPCustomStringTypeValidate/json_string (0.00s)
    --- PASS: TestAAPCustomStringTypeValidate/yaml_string_no_newline (0.00s)
    --- PASS: TestAAPCustomStringTypeValidate/unknown (0.00s)
    --- PASS: TestAAPCustomStringTypeValidate/wrong-value-type (0.00s)
    --- PASS: TestAAPCustomStringTypeValidate/null (0.00s)
    --- PASS: TestAAPCustomStringTypeValidate/empty-struct (0.00s)
    --- PASS: TestAAPCustomStringTypeValidate/json_object (0.00s)
PASS
ok  	github.com/ansible/terraform-provider-aap/internal/provider/customtypes	0.004s
FAIL
make: *** [Makefile:22: testacc] Error 1

@fincamd fincamd merged commit 2d88514 into ansible:main May 22, 2025
4 checks passed
@dleehr
Copy link
Collaborator

dleehr commented May 22, 2025

passing.txt

@fincamd fincamd deleted the feat-waitforjobcompleted-aapjob branch June 5, 2025 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants