Skip to content

chore: Overhaul CLI tests for better ergonomics.#26168

Merged
jacksonrnewhouse merged 2 commits intomainfrom
improve_cli_testing
Mar 20, 2025
Merged

chore: Overhaul CLI tests for better ergonomics.#26168
jacksonrnewhouse merged 2 commits intomainfrom
improve_cli_testing

Conversation

@jacksonrnewhouse
Copy link

We need some additional multi-node testing for the Enterprise multi-node system. The CLI tests so far have just use run() or run_with_confirmation(), which requires implementers to correctly construct the CLI commands. This change introduces a variety of Query structs that have a run() command.

Copy link
Contributor

@hiltontj hiltontj left a comment

Choose a reason for hiding this comment

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

Very nice work.

.await
.json::<Value>()
.await
.query_sql("foo")
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: The semantics of this bother me a bit it reads as "query with query" which feels weird rolling off the mental togue. What do you think about .query(<database_name>).with_sql(<sql_string>) instead? Then for influxql queries we would have .query(<database_name>).with_influxql(<influxql_string>)?

Copy link
Author

Choose a reason for hiding this comment

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

Will do!

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, I just realize I was confusing myself -- I thought this change was happening in the influxdb3_client crate and was hoping to see an improvement in the semantics of that API 🤦. Thanks for making the requested change!

@jacksonrnewhouse jacksonrnewhouse merged commit 7c02593 into main Mar 20, 2025
12 checks passed
Copy link
Contributor

@waynr waynr left a comment

Choose a reason for hiding this comment

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

This looks good to me for what it's doing (improving ergonomics of writing tests, making it easier to add standard arguments across many tests at once), although I have a minor preference as a reader of test cases for actually seeing the CLI args in plain form.

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.

3 participants