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

ARROW-5875: [FlightRPC] integration tests for Flight features #6617

Closed
wants to merge 1 commit into from

Conversation

lidavidm
Copy link
Member

This is only a minimal test (currently the basic auth protobuf). I have more tests, but they require other fixes, so I'd rather get the basic framework down and then add to it, over creating an enormous review.

@github-actions
Copy link

@lidavidm lidavidm force-pushed the flight-integration-minimal branch from e7290d1 to 235c878 Compare March 13, 2020 17:38
@wesm wesm self-requested a review March 19, 2020 00:45
Copy link
Member

@wesm wesm left a comment

Choose a reason for hiding this comment

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

The C++/Python sides of this look fine to me, @rymurr can you have a look at the Java side?

I left some minor comments

namespace arrow {
namespace flight {

Status AssertEqual(const arrow::Schema& expected, const arrow::Schema& actual) {
Copy link
Member

Choose a reason for hiding this comment

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

Using AssertSchemaEqual if you don't mind linking to libarrow_testing?

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 realized this isn't used even, so I've deleted it.


Status MakeClient(FlightClientOptions* options) override { return Status::OK(); }

Status RunClient(const Location& location,
Copy link
Member

Choose a reason for hiding this comment

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

location is not used -- what is it for?

Copy link
Member Author

Choose a reason for hiding this comment

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

It was used in test_integration_client in case the server didn't return any locations in an endpoint - I've now fixed that in the server.

if (result) {
return Status::Invalid("Action result stream has too many entries");
}
return Status::OK();
Copy link
Member

Choose a reason for hiding this comment

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

You could make a helper function to validate the results of DoAction like

Status CheckActionResults(std::vector<std::string>> results, ResultStream* stream);

Copy link
Member

Choose a reason for hiding this comment

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

You could even run the DoAction inside the helper function

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea, I've moved this into a helper function as suggested.

arrow::Status MakeServer(std::unique_ptr<arrow::flight::FlightServerBase>* server,
arrow::flight::FlightServerOptions* options) override {
(void)server;
(void)options;
Copy link
Member

Choose a reason for hiding this comment

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

You can use ARROW_UNUSED

Status RunClient(const Location& location,
std::unique_ptr<FlightClient> client) override {
(void)location;
(void)client;
Copy link
Member

Choose a reason for hiding this comment

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

ARROW_UNUSED

def __new__(cls, name, description, skip=None):
skip = skip or set()
return super().__new__(
cls, name=name, description=description, skip=skip)
Copy link
Member

Choose a reason for hiding this comment

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

Unless you expect this to be used in performance/memory use sensitive contexts, probably a "boring" object would be clearer:

class Scenario:
    """
    An integration test scenario for Arrow Flight.
    Does not correspond to a particular IPC JSON file.
    """
    def __init__(self, name, description, skip=None):
        self.name = name
        self.description = description
        self.skip = skip or set()

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, I've made this a normal object.

@lidavidm lidavidm force-pushed the flight-integration-minimal branch 2 times, most recently from b5afe3e to 2811a54 Compare March 21, 2020 14:51
@rymurr
Copy link
Contributor

rymurr commented Mar 21, 2020

Looks good to me. The only thing I didn't quite understand was the change to ServerAuthInterceptor was this required from the integration testing or is this a cosmetic change bundled in?

@lidavidm
Copy link
Member Author

Hmm, that is mostly a cosmetic change bundled in to allow you to override the response code/message, but I can remove the RuntimeException catch as that's unnecessary/too broad.

@rymurr
Copy link
Contributor

rymurr commented Mar 21, 2020

Agreed, that also keeps the behaviour roughly as before (minus the extra info catches)

@lidavidm lidavidm force-pushed the flight-integration-minimal branch from 2811a54 to 8fac39b Compare March 22, 2020 13:02
@lidavidm
Copy link
Member Author

Alright, I've removed the extra catch block from the Java side.

@rymurr
Copy link
Contributor

rymurr commented Mar 22, 2020

👍 looks good to me!

@lidavidm lidavidm force-pushed the flight-integration-minimal branch from 8fac39b to b7f52b6 Compare March 25, 2020 13:23
@lidavidm
Copy link
Member Author

I've rebased this to fix merge conflicts. Looks like the Ruby build fails in an unrelated issue, trying to fetch something from sourceforge to build docs.

@emkornfield
Copy link
Contributor

@wesm is this good to merge from your side?

@lidavidm lidavidm force-pushed the flight-integration-minimal branch 2 times, most recently from 50707c2 to 0ebae59 Compare April 16, 2020 12:25
@lidavidm
Copy link
Member Author

Rebased and fixed deprecations.

@lidavidm lidavidm force-pushed the flight-integration-minimal branch from 0ebae59 to 31784d1 Compare May 8, 2020 12:13
@lidavidm
Copy link
Member Author

lidavidm commented May 8, 2020

Rebased again to fix merge conflicts.

@wesm
Copy link
Member

wesm commented May 8, 2020

+1, sorry for the delay in merging this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants