-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add snapshot testing to CLI & set up AWS mock #13672
base: main
Are you sure you want to change the base?
Changes from 2 commits
2887bb9
813d634
c3de620
0e11d36
cb7da8c
7c2b3fe
9146e4b
9d856c3
0574ab8
2045495
06c013d
4870219
a02625e
65809a7
05a562f
36f8550
921f229
107c515
2d430a0
4b56506
1581e7a
ad9734e
0b24daa
5f29c00
a3826d4
9cb1c99
53c9c51
eb87f60
855315f
fd3240d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# you should have localstack up, e.g by | ||
#$ LOCALSTACK_VERSION=sha256:a0b79cb2430f1818de2c66ce89d41bba40f5a1823410f5a7eaf3494b692eed97 | ||
#$ podman run -d -p 4566:4566 localstack/localstack@$LOCALSTACK_VERSION | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. arguably docker is kind of more standard way. also, would it be possible not to require manual copy-pasting of the commmands? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I initially stole it from https://github.com/apache/arrow-rs/blob/9047d99f6bf87582532ee6ed0acb3f2d5f889f11/object_store/CONTRIBUTING.md?plain=1#L43 - but yes, made consistent now 🤗 |
||
#$ podman run -d -p 1338:1338 amazon/amazon-ec2-metadata-mock:v1.9.2 --imdsv2 | ||
|
||
export TEST_INTEGRATION=1 | ||
export AWS_DEFAULT_REGION=us-east-1 | ||
export AWS_ACCESS_KEY_ID=test | ||
export AWS_SECRET_ACCESS_KEY=test | ||
export AWS_ENDPOINT=http://localhost:4566 | ||
export AWS_ALLOW_HTTP=true | ||
export AWS_BUCKET_NAME=test-bucket | ||
|
||
|
||
aws s3 mb s3://test-bucket --endpoint-url=$AWS_ENDPOINT | ||
aws s3 cp ../datafusion/core/tests/data/cars.csv s3://test-bucket/cars.csv --endpoint-url=$AWS_ENDPOINT |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
source: tests/cli_integration.rs | ||
info: | ||
program: datafusion-cli | ||
args: | ||
- "--command" | ||
- select 1 | ||
- "-q" | ||
- "--format" | ||
- automatic | ||
--- | ||
success: true | ||
exit_code: 0 | ||
----- stdout ----- | ||
+----------+ | ||
| Int64(1) | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How are these files generated / updated? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
+----------+ | ||
| 1 | | ||
+----------+ | ||
|
||
----- stderr ----- |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
source: tests/cli_integration.rs | ||
info: | ||
program: datafusion-cli | ||
args: | ||
- "--command" | ||
- select 1 | ||
- "-q" | ||
- "--format" | ||
- csv | ||
--- | ||
success: true | ||
exit_code: 0 | ||
----- stdout ----- | ||
Int64(1) | ||
1 | ||
|
||
----- stderr ----- |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
source: tests/cli_integration.rs | ||
info: | ||
program: datafusion-cli | ||
args: | ||
- "--command" | ||
- select 1 | ||
- "-q" | ||
- "--format" | ||
- json | ||
--- | ||
success: true | ||
exit_code: 0 | ||
----- stdout ----- | ||
[{"Int64(1)":1}] | ||
|
||
----- stderr ----- |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
source: tests/cli_integration.rs | ||
info: | ||
program: datafusion-cli | ||
args: | ||
- "--command" | ||
- select 1 | ||
- "-q" | ||
- "--format" | ||
- nd-json | ||
--- | ||
success: true | ||
exit_code: 0 | ||
----- stdout ----- | ||
{"Int64(1)":1} | ||
|
||
----- stderr ----- |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
source: tests/cli_integration.rs | ||
info: | ||
program: datafusion-cli | ||
args: | ||
- "--command" | ||
- select 1 | ||
- "-q" | ||
- "--format" | ||
- table | ||
--- | ||
success: true | ||
exit_code: 0 | ||
----- stdout ----- | ||
+----------+ | ||
| Int64(1) | | ||
+----------+ | ||
| 1 | | ||
+----------+ | ||
|
||
----- stderr ----- |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
source: tests/cli_integration.rs | ||
info: | ||
program: datafusion-cli | ||
args: | ||
- "--command" | ||
- select 1 | ||
- "-q" | ||
- "--format" | ||
- tsv | ||
--- | ||
success: true | ||
exit_code: 0 | ||
----- stdout ----- | ||
Int64(1) | ||
1 | ||
|
||
----- stderr ----- |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
source: tests/cli_integration.rs | ||
info: | ||
program: datafusion-cli | ||
args: | ||
- "--command" | ||
- show datafusion.execution.batch_size | ||
- "-q" | ||
- "-b" | ||
- "1" | ||
--- | ||
success: true | ||
exit_code: 0 | ||
----- stdout ----- | ||
+---------------------------------+-------+ | ||
| name | value | | ||
+---------------------------------+-------+ | ||
| datafusion.execution.batch_size | 1 | | ||
+---------------------------------+-------+ | ||
|
||
----- stderr ----- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be nice to pull "test_storage_integration" out of the test name automatically, to avoid copy-paste mistakes.
fwiw such functionality exists in the goldie crate (that's also for output testing), and is as simple as
(admittedly hacky, but quite helpful)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, fixed in 53c9c51