Skip to content

Commit

Permalink
call_python: Rewrite test in Python
Browse files Browse the repository at this point in the history
  • Loading branch information
EricCousineau-TRI committed Apr 27, 2018
1 parent aa70a7d commit b408eb1
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 241 deletions.
24 changes: 15 additions & 9 deletions common/proto/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ load(
"drake_cc_googletest",
"drake_cc_library",
)
load(
"//tools/skylark:drake_py.bzl",
"drake_py_binary",
"drake_py_library",
"drake_py_unittest",
)
load(
"@drake//tools/skylark:drake_proto.bzl",
"drake_cc_proto_library",
Expand Down Expand Up @@ -60,7 +66,7 @@ drake_cc_library(
],
)

py_library(
drake_py_library(
name = "call_python_client",
srcs = ["call_python_client.py"],
imports = ["."],
Expand All @@ -69,7 +75,7 @@ py_library(
],
)

py_binary(
drake_py_binary(
name = "call_python_client_cli",
srcs = ["call_python_client.py"],
main = "call_python_client.py",
Expand Down Expand Up @@ -123,8 +129,7 @@ drake_cc_googletest(
)

drake_cc_googletest(
name = "call_python_test",
srcs = ["test/call_python_test.cc"],
name = "call_python_server_test",
tags = ["manual"],
deps = [
":call_python",
Expand All @@ -133,17 +138,18 @@ drake_cc_googletest(

# TODO(eric.cousineau): Add a test which will use an interactive matplotlib
# backend on CI only.
sh_test(
name = "call_python_full_test",
drake_py_unittest(
name = "call_python_test",
size = "small",
srcs = ["test/call_python_full_test.sh"],
data = [
":call_python_client_cli",
":call_python_test",
":call_python_server_test",
],
# Do not isolate, as we wish to access neighboring files.
isolate = False,
# TODO(eric.cousineau): Find the source of (more) sporadic CI failures, but
# after refactoring the script into Python.
flaky = 1,
# flaky = 1,
)

drake_cc_googletest(
Expand Down
230 changes: 0 additions & 230 deletions common/proto/test/call_python_full_test.sh

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#include "drake/common/proto/call_python.h"

#include <chrono>
#include <cmath>
#include <string>
Expand All @@ -8,6 +6,8 @@
#include <gflags/gflags.h>
#include <gtest/gtest.h>

#include "drake/common/proto/call_python.h"

DEFINE_string(file, "/tmp/python_rpc",
"File written to by this binary, read by client.");
// This file signals to `call_python_full_test.sh` that a full execution has
Expand Down
Loading

0 comments on commit b408eb1

Please sign in to comment.