Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ gazelle(

alias(
name = "smoke_tests",
actual = "//tests/smoke:smoke",
actual = "//tests/smoke:go_default_test",
)

alias(
Expand Down Expand Up @@ -74,12 +74,12 @@ alias(

pkg_tar(
name = "tectonic-%s" % TECTONIC_VERSION,
mode = "0666",
srcs = [
"//:template_resources",
"//examples:tectonic_cli_examples",
],
extension = "tar.gz",
mode = "0666",
package_dir = "tectonic-%s" % TECTONIC_VERSION,
strip_prefix = ".",
deps = [
Expand All @@ -90,8 +90,8 @@ pkg_tar(

pkg_tar(
name = "cli_bin",
mode = "0777",
srcs = ["//installer/cmd/tectonic"],
mode = "0777",
package_dir = "installer",
)

Expand All @@ -105,8 +105,8 @@ filegroup(

pkg_tar(
name = "tf_bin",
mode = "0777",
srcs = [":terraform_runtime"],
mode = "0777",
package_dir = "installer",
)

Expand Down
14 changes: 0 additions & 14 deletions Documentation/dev/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,6 @@ tectonic_1.2.3-beta

*Note*: the generated tarball will not include the version string in its own name since output names must be known ahead of time in Bazel. To include the version in the tarball name, copy or move the archive with the desired name in the destination.

## Building the Smoke Test Binary

We also use Bazel to build the smoke test binary. To do so, run:

```sh
bazel build tests/smoke
```

This operation will produce a binary located at `bazel-bin/tests/smoke/linux_amd64_stripped/smoke`, if on a Linux machine, or `bazel-bin/tests/smoke/darwin_amd64_stripped/smoke`, if on a Mac.
Follow the [smoke test instructions][smoke-test] to test a Tectonic cluster using this newly compiled binary.


## Cleaning

You can cleanup all generated files by running:
Expand All @@ -110,5 +98,3 @@ Additionally you can remove all toolchains (in addition to the generated files)
```sh
bazel clean --expunge
```

[smoke-test]: ../../tests/smoke/README.md
4 changes: 2 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ http_archive(
http_archive(
name = "bazel_gazelle",
url = "https://github.com/bazelbuild/bazel-gazelle/releases/download/0.12.0/bazel-gazelle-0.12.0.tar.gz",
sha256 = "ddedc7aaeb61f2654d7d7d4fd7940052ea992ccdb031b8f9797ed143ac7e8d43"
sha256 = "ddedc7aaeb61f2654d7d7d4fd7940052ea992ccdb031b8f9797ed143ac7e8d43",
)

load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains", "go_repository")
load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains")

go_rules_dependencies()

Expand Down
5 changes: 4 additions & 1 deletion installer/pkg/config-generator/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,8 @@ go_test(
srcs = ["generator_test.go"],
data = glob(["fixtures/**"]),
embed = [":go_default_library"],
deps = ["//installer/pkg/config:go_default_library"],
deps = [
"//installer/pkg/config:go_default_library",
"//installer/pkg/tls:go_default_library",
],
)
4 changes: 1 addition & 3 deletions installer/pkg/config/aws/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "go_default_library",
srcs = [
"aws.go",
],
srcs = ["aws.go"],
importpath = "github.com/openshift/installer/installer/pkg/config/aws",
visibility = ["//visibility:public"],
)
8 changes: 2 additions & 6 deletions installer/pkg/copy/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,14 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
name = "go_default_library",
srcs = [
"copy.go",
],
srcs = ["copy.go"],
importpath = "github.com/openshift/installer/installer/pkg/copy",
visibility = ["//visibility:public"],
)

go_test(
name = "go_default_test",
size = "small",
srcs = [
"copy_test.go",
],
srcs = ["copy_test.go"],
embed = [":go_default_library"],
)
6 changes: 3 additions & 3 deletions tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ function destroy() {
trap destroy EXIT

echo -e "\\e[36m Starting build process...\\e[0m"
bazel build tarball tests/smoke
bazel build tarball smoke_tests
# In future bazel build could be extracted to another job which could be running in docker container like this:
# docker run --rm -v $PWD:$PWD:Z -w $PWD quay.io/coreos/tectonic-builder:bazel-v0.3 bazel build tarball tests/smoke
# docker run --rm -v $PWD:$PWD:Z -w $PWD quay.io/coreos/tectonic-builder:bazel-v0.3 bazel build tarball smoke_tests

echo -e "\\e[36m Unpacking artifacts...\\e[0m"
tar -zxf bazel-bin/tectonic-dev.tar.gz
cp bazel-bin/tests/smoke/linux_amd64_stripped/smoke tectonic-dev/smoke
cp bazel-bin/tests/smoke/linux_amd64_stripped/go_default_test tectonic-dev/smoke
export PATH="$(pwd)/tectonic-dev/installer:${PATH}"
cd tectonic-dev

Expand Down
39 changes: 2 additions & 37 deletions tests/smoke/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,32 +1,4 @@
load("@io_bazel_rules_go//go:def.bzl", "go_test", "go_prefix")

go_prefix("github.com/openshift/installer/tests/smoke/tests/smoke")

go_test(
name = "smoke",
srcs = [
"cluster_test.go",
"common_test.go",
"smoke_test.go",
],
visibility = ["//visibility:public"],
deps = [
"//tests/smoke/vendor/github.com/coreos/ktestutil/testworkload:go_default_library",
"//tests/smoke/vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library",
"//tests/smoke/vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//tests/smoke/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured:go_default_library",
"//tests/smoke/vendor/k8s.io/apimachinery/pkg/util/errors:go_default_library",
"//tests/smoke/vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library",
"//tests/smoke/vendor/k8s.io/client-go/kubernetes:go_default_library",
"//tests/smoke/vendor/k8s.io/client-go/pkg/api:go_default_library",
"//tests/smoke/vendor/k8s.io/client-go/pkg/api/v1:go_default_library",
"//tests/smoke/vendor/k8s.io/client-go/pkg/apis/extensions/v1beta1:go_default_library",
"//tests/smoke/vendor/k8s.io/client-go/pkg/apis/rbac/v1beta1:go_default_library",
"//tests/smoke/vendor/k8s.io/client-go/tools/clientcmd:go_default_library",
"//tests/smoke/vendor/k8s.io/kubernetes/pkg/kubectl/cmd/util:go_default_library",
"//tests/smoke/vendor/k8s.io/kubernetes/pkg/kubectl/resource:go_default_library",
],
)
load("@io_bazel_rules_go//go:def.bzl", "go_test")

go_test(
name = "go_default_test",
Expand All @@ -35,6 +7,7 @@ go_test(
"common_test.go",
"smoke_test.go",
],
visibility = ["//visibility:public"],
deps = [
"//tests/smoke/vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//tests/smoke/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured:go_default_library",
Expand All @@ -46,11 +19,3 @@ go_test(
"//tests/smoke/vendor/k8s.io/kubernetes/pkg/kubectl/resource:go_default_library",
],
)

filegroup(
name = "test_vars",
srcs = [
"aws/vars/aws.tfvars.json",
],
visibility = ["//visibility:public"],
)
20 changes: 5 additions & 15 deletions tests/smoke/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@

This directory contains all smoke tests for Tectonic.
The smoke tests are a set of Golang test files that perform minimal validation of a running Tectonic cluster.
This directory is further partitioned into platform-specific directories and should conform to the following directory hierarchy:

```
smoke/
├── aws # Smoke tests for AWS
│   └── vars # Terraform tfvars files for AWS smoke tests
├── *_test.go # Smoke tests for all platforms
├── vendor # Smoke test dependencies
└── ...
```

## Getting Started

Expand All @@ -34,18 +24,18 @@ Compile the smoke test binary from the root directory of the project:
bazel build tests/smoke
```

The tests can then be run by invoking the `smoke` binary in the `bazel-bin/tests/smoke/linux_amd64_stripped` directory.
The tests can then be run by invoking the `go_default_test` binary in the `bazel-bin/tests/smoke/linux_amd64_stripped` directory.
This binary accepts the `--cluster` flag to specify which tests suites should be run, e.g.:

```sh
bazel-bin/tests/smoke/linux_amd64_stripped/smoke --cluster
bazel-bin/tests/smoke/linux_amd64_stripped/go_default_test --cluster
```

*Note*: the `smoke` binary accepts several flags available to the `go test` command; to list them, invoke the `smoke` binary with the `--help` flag.
*Note*: the `go_default_test` binary accepts several flags available to the `go test` command; to list them, invoke the `go_default_test` binary with the `--help` flag.
For example, to run the cluster suite verbosely, use the `--test.v` flag:

```sh
bazel-bin/tests/smoke/linux_amd64_stripped/smoke --cluster --test.v
bazel-bin/tests/smoke/linux_amd64_stripped/go_default_test --cluster --test.v
```

## Cluster Suite
Expand All @@ -68,5 +58,5 @@ export SMOKE_MANIFEST_EXPERIMENTAL=true

To run the cluster test suite, invoke the smoke test binary with the `--cluster` flag:
```sh
bazel-bin/tests/smoke/linux_amd64_stripped/smoke --cluster
bazel-bin/tests/smoke/linux_amd64_stripped/go_default_test --cluster
```
107 changes: 0 additions & 107 deletions tests/smoke/aws/README.md

This file was deleted.

42 changes: 0 additions & 42 deletions tests/smoke/aws/vars/aws-basic.yaml

This file was deleted.

1 change: 1 addition & 0 deletions tests/smoke/vendor/cloud.google.com/go/BUILD.bazel

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading