From e73f0d5fd3df2db70bd7634d14f206be834ad4f5 Mon Sep 17 00:00:00 2001 From: Matthieu Date: Wed, 8 Sep 2021 19:41:35 +0400 Subject: [PATCH] fix tests --- .github/workflows/bazel-build.yml | 2 +- BUILD | 10 ++++++++++ gateway/BUILD | 4 ++-- novactl/BUILD.bazel | 4 +++- ratelimiter/BUILD | 3 +-- webhook/BUILD | 4 ++-- 6 files changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/workflows/bazel-build.yml b/.github/workflows/bazel-build.yml index 7f52cdb..1fcffd8 100644 --- a/.github/workflows/bazel-build.yml +++ b/.github/workflows/bazel-build.yml @@ -47,7 +47,7 @@ jobs: - name: Execute Bazel tests shell: bash run: | - bazel test //:test + bazel test //:tests # Runs a set of commands using the runners shell - name: Execute build script shell: bash diff --git a/BUILD b/BUILD index 791364d..cf4ac62 100644 --- a/BUILD +++ b/BUILD @@ -27,6 +27,16 @@ container_bundle( } ) +test_suite( + name = "tests", + tests = [ + "//novactl:tests", + "//webhook:tests", + "//gateway:tests", + "//ratelimiter:tests" + ], +) + container_push( name = "publish", bundle = ":bundle", diff --git a/gateway/BUILD b/gateway/BUILD index 738c669..2413b4d 100644 --- a/gateway/BUILD +++ b/gateway/BUILD @@ -5,7 +5,7 @@ load("@io_bazel_rules_docker//rust:image.bzl", "rust_image") load("@io_bazel_rules_docker//docker/package_managers:download_pkgs.bzl", "download_pkgs") load("@io_bazel_rules_docker//docker/package_managers:install_pkgs.bzl", "install_pkgs") -exports_files(["Cargo.toml"]) +test_suite(name = "tests") rust_binary( name = "gateway", @@ -20,4 +20,4 @@ rust_image( binary = ":gateway", visibility = ["//visibility:public"], base = "@ubuntu1604//image", -) \ No newline at end of file +) diff --git a/novactl/BUILD.bazel b/novactl/BUILD.bazel index 44d9a19..5c5a33c 100644 --- a/novactl/BUILD.bazel +++ b/novactl/BUILD.bazel @@ -1,6 +1,8 @@ load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") load("@io_bazel_rules_docker//go:image.bzl", "go_image") +test_suite(name = "tests") + go_library( name = "novactl_lib", srcs = ["main.go"], @@ -22,4 +24,4 @@ go_image( name = "image", embed = [":novactl_lib"], visibility = ["//visibility:public"], -) \ No newline at end of file +) diff --git a/ratelimiter/BUILD b/ratelimiter/BUILD index 3a8b2e4..f9143e1 100644 --- a/ratelimiter/BUILD +++ b/ratelimiter/BUILD @@ -3,14 +3,13 @@ load("@rules_rust//cargo:cargo_build_script.bzl", "cargo_build_script") load("//cargo:crates.bzl", "all_crate_deps", "crate_deps") load("@io_bazel_rules_docker//rust:image.bzl", "rust_image") -exports_files(["Cargo.toml"]) +test_suite(name = "tests") cargo_build_script( name = "build_script", srcs = ["build.rs"], build_script_env = { "PROTOC": "$(location @com_google_protobuf//:protoc)", - "PROTO": "$(location //ratelimiter/proto:nova.ratelimit.v1.proto)" }, data = [ "//ratelimiter/proto:nova.ratelimit.v1.proto", diff --git a/webhook/BUILD b/webhook/BUILD index 84c04f6..4e99e2c 100644 --- a/webhook/BUILD +++ b/webhook/BUILD @@ -2,7 +2,7 @@ load("@rules_rust//rust:rust.bzl", "rust_binary", "rust_test") load("//cargo:crates.bzl", "all_crate_deps") load("@io_bazel_rules_docker//rust:image.bzl", "rust_image") -exports_files(["Cargo.toml"]) +test_suite(name = "tests") rust_binary( name = "webhook", @@ -22,4 +22,4 @@ rust_image( srcs = glob(["src/**"]), deps = all_crate_deps(), visibility = ["//visibility:public"], -) \ No newline at end of file +) -- 2.39.5