From afc9980eeef14a151be0b336a7d36312b2e9c5ab Mon Sep 17 00:00:00 2001 From: Adriano Cunha <35786489+adrcunha@users.noreply.github.com> Date: Tue, 25 Sep 2018 10:35:21 -0700 Subject: [PATCH] Create a smoke test for test-infra (#138) * Create a smoke test for test-infra This will ensure the test infrastructure is not broken. Fixes #7. Bonus: remove the `dummy.go` file. * Restrict unit tests to `/test`, as it's the only directory with tests --- dummy.go | 10 ---------- test/presubmit-tests.sh | 3 ++- test/smoke_test.go | 25 +++++++++++++++++++++++++ 3 files changed, 27 insertions(+), 11 deletions(-) delete mode 100644 dummy.go create mode 100644 test/smoke_test.go diff --git a/dummy.go b/dummy.go deleted file mode 100644 index c32a5c7d3ae..00000000000 --- a/dummy.go +++ /dev/null @@ -1,10 +0,0 @@ -package main - -import ( - "fmt" -) - -func main() { - fmt.Println("This is a dummy go file so `go dep` can be used with knative/test-infra repo") - fmt.Println("This file can be removed once the repo contains real, useful go code") -} diff --git a/test/presubmit-tests.sh b/test/presubmit-tests.sh index 57ad79b2f15..20cfc3c34cf 100755 --- a/test/presubmit-tests.sh +++ b/test/presubmit-tests.sh @@ -36,7 +36,8 @@ function build_tests() { } function unit_tests() { - header "TODO(#7): Running unit tests" + header "Running unit tests" + report_go_test ./test/... } function integration_tests() { diff --git a/test/smoke_test.go b/test/smoke_test.go new file mode 100644 index 00000000000..c7d37cea143 --- /dev/null +++ b/test/smoke_test.go @@ -0,0 +1,25 @@ +/* +Copyright 2018 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package smoke + +import ( + "testing" +) + +func TestTestingInfrastructureWorks(t *testing.T) { + // Always succeed. +}