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

Remove superfluous err argument in NoError test function #1935

Merged
merged 3 commits into from
Feb 16, 2023

Conversation

pietern
Copy link
Contributor

@pietern pietern commented Jan 18, 2023

I noticed the duplicate message in an assertion failure. This is caused by passing err as message to NoError.

    resource_token_test.go:272: 
        	Error Trace:	<...>/tokens/resource_token_test.go:272
        	Error:      	Received unexpected error:
        	            	Post "***/api/2.0/token/create": context deadline exceeded [...]
        	Test:       	TestAccCreateToken
        	Messages:   	Post "***/api/2.0/token/create": context deadline exceeded [...]

@pietern pietern requested review from alexott and nfx January 18, 2023 07:54
@@ -52,7 +52,7 @@ func TestResourceAzureBlobMountCreate(t *testing.T) {
},
Create: true,
}.Apply(t)
require.NoError(t, err, err) // TODO: global search-replace for NoError
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: someone before me may have meant to change this before.

Copy link
Contributor

@alexott alexott left a comment

Choose a reason for hiding this comment

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

lgtm

@codecov-commenter
Copy link

codecov-commenter commented Jan 18, 2023

Codecov Report

Merging #1935 (6e074b8) into master (79c6338) will increase coverage by 0.00%.
The diff coverage is 81.81%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1935   +/-   ##
=======================================
  Coverage   90.19%   90.19%           
=======================================
  Files         146      146           
  Lines       11843    11844    +1     
=======================================
+ Hits        10682    10683    +1     
  Misses        748      748           
  Partials      413      413           
Impacted Files Coverage Δ
qa/testing.go 81.11% <81.81%> (+0.07%) ⬆️

Copy link
Contributor

@nfx nfx left a comment

Choose a reason for hiding this comment

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

could you .ApplyNoError for resource fixtures? global replace for other places looks good

access/resource_ip_access_list_test.go Show resolved Hide resolved
Copy link
Contributor

@nfx nfx left a comment

Choose a reason for hiding this comment

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

please don't add *schema.ResourceData to ApplyNoError. We have ApplyAndExpectData for resource data assertions

qa/testing.go Outdated Show resolved Hide resolved
@pietern
Copy link
Contributor Author

pietern commented Feb 15, 2023

@nfx Output of git grep "err, err" doesn't contain these anymore.

@nfx nfx enabled auto-merge (squash) February 16, 2023 10:38
@nfx nfx merged commit 5f6b822 into databricks:master Feb 16, 2023
@nfx nfx mentioned this pull request Feb 21, 2023
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.

4 participants