Skip to content

Conversation

soheiokamoto
Copy link
Contributor

This adds import tests for cloudflare_logpush_jobs resource, per https://wiki.cfdata.org/display/API/Terraform+Acceptance+Tests

  • I understand that this repository is auto-generated and my pull request may not be merged

@soheiokamoto
Copy link
Contributor Author

The local test fails, most likely due to mixed version (4 vs 5), though not sure how to point it to the right one:

soheiokamoto/terraform-provider-cloudflare [sohei/DS-15398-add-import-tests-for-logpush-jobs] $ go test ./internal/services/logpush_job -run "^TestAccCloudflareLogpushJob_" -v -count 1

=== RUN   TestAccCloudflareLogpushJob_Basic
    resource_test.go:82: Step 3/3 error running import: exit status 1
        
        Error: invalid ID
        
        expected urlencoded segments
        "<{accounts|zones}/{account_id|zone_id}>/<job_id>", got "1160069"
        
        
        Error: invalid discriminator segment - <{accounts|zones}/{account_id|zone_id}>
        
        expected discriminator to be one of {accounts|zones}
        
--- FAIL: TestAccCloudflareLogpushJob_Basic (7.80s)
=== RUN   TestAccCloudflareLogpushJob_BasicOutputOptions
    resource_test.go:150: Step 3/3 error running import: exit status 1
        
        Error: invalid ID
        
        expected urlencoded segments
        "<{accounts|zones}/{account_id|zone_id}>/<job_id>", got "1160070"
        
        
        Error: invalid discriminator segment - <{accounts|zones}/{account_id|zone_id}>
        
        expected discriminator to be one of {accounts|zones}
        
--- FAIL: TestAccCloudflareLogpushJob_BasicOutputOptions (7.47s)
=== RUN   TestAccCloudflareLogpushJob_Full
    resource_test.go:249: Step 3/3 error running import: exit status 1
        
        Error: invalid ID
        
        expected urlencoded segments
        "<{accounts|zones}/{account_id|zone_id}>/<job_id>", got "1160071"
        
        
        Error: invalid discriminator segment - <{accounts|zones}/{account_id|zone_id}>
        
        expected discriminator to be one of {accounts|zones}
        
--- FAIL: TestAccCloudflareLogpushJob_Full (7.44s)
=== RUN   TestAccCloudflareLogpushJob_ImmutableFields
    resource_test.go:359: Step 3/3 error running import: exit status 1
        
        Error: invalid ID
        
        expected urlencoded segments
        "<{accounts|zones}/{account_id|zone_id}>/<job_id>", got "1160072"
        
        
        Error: invalid discriminator segment - <{accounts|zones}/{account_id|zone_id}>
        
        expected discriminator to be one of {accounts|zones}
        
--- FAIL: TestAccCloudflareLogpushJob_ImmutableFields (5.47s)
FAIL
FAIL    github.com/cloudflare/terraform-provider-cloudflare/internal/services/logpush_job       28.196s
FAIL

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.

1 participant