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

feat: Add INSERT_ONLY option to streams #655

Merged
merged 8 commits into from
Aug 23, 2021
Merged

feat: Add INSERT_ONLY option to streams #655

merged 8 commits into from
Aug 23, 2021

Conversation

momer
Copy link
Contributor

@momer momer commented Aug 20, 2021

Add INSERT_ONLY as a DDL option to streams resource in support of insert only streams on external tables.

Test Plan

  • unit tests
  • Note: I didn't see any validation to help avoid conflicting settings in other modules, (e.g. APPEND_ONLY and INSERT_ONLY) so didn't add any here as I imagine that is a purposeful decision.

References

@momer momer requested a review from a team as a code owner August 20, 2021 21:15
@momer momer requested a review from alldoami August 20, 2021 21:15
@alldoami
Copy link
Contributor

/ok-to-test sha=5df4f89

@alldoami alldoami changed the title Add INSERT_ONLY option to streams feat: Add INSERT_ONLY option to streams Aug 20, 2021
@github-actions
Copy link

Integration tests failure for 5df4f89

@momer
Copy link
Contributor Author

momer commented Aug 20, 2021

Duh. Sorry about that - didn't realize there were other changes needed to be made in resources patching now.

@momer
Copy link
Contributor Author

momer commented Aug 23, 2021

@alldoami these tests should be ready trigger again - note failures are for integration tests lacking a username etc.

➜  terraform-provider-snowflake git:(feature/add-insert-only-option-snowflake-streams) SKIP_MANAGED_ACCOUNT_TEST=1 TF_ACC=1 go test -run '.*?Stream.*' -v -coverprofile=coverage.txt -covermode=atomic ./...
?       github.com/chanzuckerberg/terraform-provider-snowflake  [no test files]
=== RUN   TestAccStreams
=== PAUSE TestAccStreams
=== CONT  TestAccStreams
    streams_acceptance_test.go:17: Step 1/1 error: Error running pre-apply refresh: exit status 1
        
        Error: Missing required argument
        
        The argument "username" is required, but was not set.
        
        Error: Missing required argument
        
        The argument "account" is required, but was not set.
--- FAIL: TestAccStreams (0.50s)
FAIL
coverage: 4.2% of statements
FAIL    github.com/chanzuckerberg/terraform-provider-snowflake/pkg/datasources  0.883s
?       github.com/chanzuckerberg/terraform-provider-snowflake/pkg/db   [no test files]
testing: warning: no tests to run
PASS
coverage: 0.0% of statements
ok      github.com/chanzuckerberg/terraform-provider-snowflake/pkg/provider     0.252s  coverage: 0.0% of statements [no tests to run]
=== RUN   TestStreamIDFromString
--- PASS: TestStreamIDFromString (0.00s)
=== RUN   TestStreamStruct
--- PASS: TestStreamStruct (0.00s)
=== RUN   TestStreamOnTableIDFromString
--- PASS: TestStreamOnTableIDFromString (0.00s)
=== RUN   TestAcc_Stream
=== PAUSE TestAcc_Stream
=== RUN   TestAccStreamGrant_basic
    stream_grant_acceptance_test.go:21: Step 1/1 error: Error running pre-apply refresh: exit status 1
        
        Error: Missing required argument
        
        The argument "username" is required, but was not set.
        
        Error: Missing required argument
        
        The argument "account" is required, but was not set.
--- FAIL: TestAccStreamGrant_basic (0.46s)
=== RUN   TestAccStreamGrante_future
    stream_grant_acceptance_test.go:44: Step 1/1 error: Error running pre-apply refresh: exit status 1
        
        Error: Missing required argument
        
        The argument "account" is required, but was not set.
        
        Error: Missing required argument
        
        The argument "username" is required, but was not set.
--- FAIL: TestAccStreamGrante_future (0.46s)
=== RUN   TestStreamGrant
--- PASS: TestStreamGrant (0.00s)
=== RUN   TestStreamGrantCreate
--- PASS: TestStreamGrantCreate (0.00s)
=== RUN   TestStreamGrantRead
--- PASS: TestStreamGrantRead (0.00s)
=== RUN   TestFutureStreamGrantCreate
--- PASS: TestFutureStreamGrantCreate (0.00s)
=== RUN   TestStream
--- PASS: TestStream (0.00s)
=== RUN   TestStreamCreate
--- PASS: TestStreamCreate (0.00s)
=== RUN   TestStreamRead
--- PASS: TestStreamRead (0.00s)
=== RUN   TestStreamDelete
--- PASS: TestStreamDelete (0.00s)
=== RUN   TestStreamUpdate
--- PASS: TestStreamUpdate (0.00s)
=== CONT  TestAcc_Stream
    stream_acceptance_test.go:15: Step 1/1 error: Error running pre-apply refresh: exit status 1
        
        Error: Missing required argument
        
        The argument "username" is required, but was not set.
        
        Error: Missing required argument
        
        The argument "account" is required, but was not set.
--- FAIL: TestAcc_Stream (0.44s)
FAIL
coverage: 5.5% of statements
FAIL    github.com/chanzuckerberg/terraform-provider-snowflake/pkg/resources    1.726s
=== RUN   TestStreamCreate
--- PASS: TestStreamCreate (0.00s)
=== RUN   TestStreamChangeComment
--- PASS: TestStreamChangeComment (0.00s)
=== RUN   TestStreamRemoveComment
--- PASS: TestStreamRemoveComment (0.00s)
=== RUN   TestStreamDrop
--- PASS: TestStreamDrop (0.00s)
=== RUN   TestStreamShow
--- PASS: TestStreamShow (0.00s)
PASS
coverage: 1.7% of statements
ok      github.com/chanzuckerberg/terraform-provider-snowflake/pkg/snowflake    0.298s  coverage: 1.7% of statements
?       github.com/chanzuckerberg/terraform-provider-snowflake/pkg/testhelpers  [no test files]
testing: warning: no tests to run
PASS
coverage: 0.0% of statements
ok      github.com/chanzuckerberg/terraform-provider-snowflake/pkg/validation   0.174s  coverage: 0.0% of statements [no tests to run]
?       github.com/chanzuckerberg/terraform-provider-snowflake/pkg/version      [no test files]
FAIL

@alldoami
Copy link
Contributor

/ok-to-test sha=dd06679

@alldoami
Copy link
Contributor

Can you run make docs :)

@github-actions
Copy link

Integration tests success for dd06679

@momer
Copy link
Contributor Author

momer commented Aug 23, 2021

Hey @alldoami ran make docs! Thanks again for bearing with me on this

@alldoami
Copy link
Contributor

/ok-to-test sha=84a6234

@github-actions
Copy link

Integration tests success for 84a6234

@alldoami alldoami merged commit c906e01 into Snowflake-Labs:main Aug 23, 2021
anton-chekanov pushed a commit to anton-chekanov/terraform-provider-snowflake that referenced this pull request Jan 25, 2022
daniepett pushed a commit to daniepett/terraform-provider-snowflake that referenced this pull request Feb 9, 2022
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.

2 participants