From 0430b40b826fd1040ad39621cf733f9d58da2a02 Mon Sep 17 00:00:00 2001 From: Alex Buchanan Date: Thu, 15 Mar 2018 16:03:43 -0700 Subject: [PATCH] docs: hide internal compute utils --- compute/hpc_backend.go | 2 +- compute/hpc_backend_test.go | 2 +- compute/util.go | 4 ++-- examples/examples_test.go | 8 ++------ worker/noop.go | 12 ------------ 5 files changed, 6 insertions(+), 22 deletions(-) delete mode 100644 worker/noop.go diff --git a/compute/hpc_backend.go b/compute/hpc_backend.go index bb20b434f..b57425479 100644 --- a/compute/hpc_backend.go +++ b/compute/hpc_backend.go @@ -227,7 +227,7 @@ func (b *HPCBackend) setupTemplatedHPCSubmit(task *tes.Task) (string, error) { confPath := path.Join(workdir, "worker.conf.yml") config.ToYamlFile(b.Conf, confPath) - funnelPath, err := DetectFunnelBinaryPath() + funnelPath, err := detectFunnelBinaryPath() if err != nil { return "", err } diff --git a/compute/hpc_backend_test.go b/compute/hpc_backend_test.go index 9b48a3982..3d16e7acc 100644 --- a/compute/hpc_backend_test.go +++ b/compute/hpc_backend_test.go @@ -68,7 +68,7 @@ func TestSetupTemplatedHPCSubmit(t *testing.T) { t.Fatal(rerr) } - binaryPath, err := DetectFunnelBinaryPath() + binaryPath, err := detectFunnelBinaryPath() if err != nil { t.Fatal(err) } diff --git a/compute/util.go b/compute/util.go index 2fee208f6..88fcdcbdd 100644 --- a/compute/util.go +++ b/compute/util.go @@ -5,8 +5,8 @@ import ( "os" ) -// DetectFunnelBinaryPath detects the path to the "funnel" binary -func DetectFunnelBinaryPath() (string, error) { +// detectFunnelBinaryPath detects the path to the "funnel" binary +func detectFunnelBinaryPath() (string, error) { path, err := os.Executable() if err != nil { return "", fmt.Errorf("Failed to detect path of funnel binary") diff --git a/examples/examples_test.go b/examples/examples_test.go index c6c16c7fd..eb6021320 100644 --- a/examples/examples_test.go +++ b/examples/examples_test.go @@ -8,13 +8,9 @@ import ( ) func TestExamplesAreValid(t *testing.T) { - for _, en := range AssetNames() { - tb, err := Asset(en) - if err != nil { - t.Fatal(err) - } + for en, tb := range Examples() { var task tes.Task - err = jsonpb.UnmarshalString(string(tb), &task) + err := jsonpb.UnmarshalString(tb, &task) if err != nil { t.Fatal("unmarshal failed", en, err) } diff --git a/worker/noop.go b/worker/noop.go deleted file mode 100644 index 51763952d..000000000 --- a/worker/noop.go +++ /dev/null @@ -1,12 +0,0 @@ -package worker - -import ( - "context" -) - -// NoopWorker is useful during testing for creating a worker with a Worker -// that doesn't do anything. -type NoopWorker struct{} - -// Run doesn't do anything, it's an empty function. -func (NoopWorker) Run(context.Context) {}