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 IPC integration test executable #585

Merged
merged 9 commits into from
Aug 15, 2024

Conversation

bkietz
Copy link
Member

@bkietz bkietz commented Aug 13, 2024

@bkietz bkietz requested a review from paleolimbot August 13, 2024 21:58
Copy link
Member

@paleolimbot paleolimbot left a comment

Choose a reason for hiding this comment

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

I think this file would fit better as integration/ipc_integration.cc, next to the C data integration tests. You could separate them into a support lib/exe like Arrow C++, or you could build the main() function only if something is defined to ensure you can link to it from your tests.

I do think this would benefit from tests (e.g., to ensure error messages actually show up). I believe there are a few like that for the C Data integration functions (just enough to make sure everything is plugged in).

src/nanoarrow/ipc/json_integration.cc Outdated Show resolved Hide resolved
src/nanoarrow/ipc/encoder.c Outdated Show resolved Hide resolved
src/nanoarrow/ipc/writer.c Outdated Show resolved Hide resolved
src/nanoarrow/ipc/json_integration.cc Outdated Show resolved Hide resolved
return 1;
}

struct File {
Copy link
Member

Choose a reason for hiding this comment

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

No need to do it in this PR, but eventually we can consolidate/test the things that appear in both the C Data integration and IPC integration tests into nanoarrowarrow_testing

src/nanoarrow/integration/ipc_integration.cc Outdated Show resolved Hide resolved
Comment on lines 84 to 90
if (argc == 1 || argv[1] == std::string{"-h"} || argv[1] == std::string{"--help"}) {
// skip printing usage if for example --gtest_list_tests is used;
// that command obviously doesn't need the extra noise
std::cerr << kUsage;
}
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
Copy link
Member

Choose a reason for hiding this comment

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

Is there any way to separate this in such a way that we're not using the same executable for both running tests and as the artifact needed for the integration test setup? Maybe a define to separate the two cases if a separate file is too hard? (No need to solve if this is time consuming!)

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this should wait for the MaterializedArrayStream follow up. When we move it to nanoarrow_testing.hpp from here and from c_data_integration.cc it'll be natural to consolidate MaterializedArrayStream's unit tests in nanoarrow_testing_test. Doing that here will bloat this PR excessively

src/nanoarrow/ipc/writer.c Show resolved Hide resolved
src/nanoarrow/nanoarrow_ipc.h Outdated Show resolved Hide resolved
src/nanoarrow/nanoarrow_ipc.h Outdated Show resolved Hide resolved
@bkietz bkietz force-pushed the ipc-integration-test branch from f214889 to 0ddbb85 Compare August 15, 2024 16:25
@bkietz bkietz force-pushed the ipc-integration-test branch from 68e75e7 to 7d78c76 Compare August 15, 2024 18:52
Copy link
Member

@paleolimbot paleolimbot left a comment

Choose a reason for hiding this comment

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

Thanks!

We can tackle testing the failure modes and/or consolidating integration test logic in a separate PR. I have full faith in your implementation but for when this is modified by a future contributor we do need a basic check to make sure that if there is a validation failure that it is actually reported (since that type of failure would be silently unnoticed in the normal integration test run).

@bkietz bkietz merged commit 2c42268 into apache:main Aug 15, 2024
34 checks passed
@bkietz bkietz deleted the ipc-integration-test branch August 15, 2024 19:40
@paleolimbot paleolimbot added this to the nanoarrow 0.6.0 milestone Sep 17, 2024
bkietz added a commit to apache/arrow that referenced this pull request Sep 24, 2024
…3715)

### Rationale for this change

Nanoarrow can now read and write IPC files as of apache/arrow-nanoarrow#585 so it should no longer be skipped as a producer/consumer

### What changes are included in this PR?

Nanoarrow's tester is updated to point to the new integration executable and to report nanoarrow as a consumer/producer of IPC files.

Notably the `null_trivial` case is skipped even though nanoarrow nominally supports it since it represents a corner case in which nanoarrow's flatbuffers library will not accept some vectors produced by other flatbuffers libraries dvidelabs/flatcc#287

### Are these changes tested?

Yes

### Are there any user-facing changes?

No

* GitHub Issue: #43680

Lead-authored-by: Benjamin Kietzman <bengilgit@gmail.com>
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
Signed-off-by: Benjamin Kietzman <bengilgit@gmail.com>
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