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

Extending script queries to allow easier testing of warning messages #810

Merged
merged 2 commits into from Feb 21, 2022

Conversation

fulghum
Copy link
Contributor

@fulghum fulghum commented Feb 21, 2022

This change lets you specify the expected number of warnings and an expected substring from test queries. It also tidies up some of the logic around running tests with expected warnings.

Example test syntax this allows you to write:

Assertions: []enginetest.ScriptTestAssertion{
	{
		Query:                           "select * from dolt_diff_t;",
		ExpectedWarning:                 1105,
		ExpectedWarningsCount:           4,
		ExpectedWarningMessageSubstring: "unable to coerce value from field",
		SkipResultsCheck:			true,
	},
},

Needed for: dolthub/dolt#2832

Copy link
Member

@zachmu zachmu left a comment

Choose a reason for hiding this comment

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

LGTM, just one comment

enginetest/enginetests.go Outdated Show resolved Hide resolved
@fulghum fulghum merged commit 4fd62f0 into main Feb 21, 2022
fulghum added a commit to dolthub/dolt that referenced this pull request Feb 22, 2022
…after adding new test utilities in go-mysql-server.

Depends on: dolthub/go-mysql-server#810
@Hydrocharged Hydrocharged deleted the fulghum/warning-test-utils branch April 6, 2022 07:39
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.

None yet

2 participants