Skip to content

Commit

Permalink
ci: execute license integration test with Bazel
Browse files Browse the repository at this point in the history
  • Loading branch information
burgerdev committed Nov 22, 2023
1 parent 8bbf3af commit 0741d54
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ build --flag_alias=container_prefix=//bazel/settings:container_prefix
# set cli edition flag alias
build --flag_alias=cli_edition=//bazel/settings:cli_edition

# disable integration tests by default
test --test_tag_filters=-integration
# enable all tests (including integration)
test:integration --test_tag_filters= --@io_bazel_rules_go//go/config:tags=integration
# enable only integration tests
test:integration-only --test_tag_filters=+integration --@io_bazel_rules_go//go/config:tags=integration

# bazel configs to explicitly target a platform
common:host --platforms @local_config_platform//:host
common:linux_amd64 --platforms @zig_sdk//libc_aware/platform:linux_amd64_gnu.2.23
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ jobs:
run: mkdir build && cd build && cmake ..

# Runs all test targets starting with "integration-"
- name: Integration Tests
- name: CMake-based Integration Tests
working-directory: build
run: ctest -R integration-

- name: Setup bazel
uses: ./.github/actions/setup_bazel_nix

- name: Integration Tests
env:
TMPDIR: ${{ runner.temp }}
run: bazel test //... --test_output=errors --config=nostamp --config=integration-only --remote_download_minimal
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ enable_testing()
# TODO(malt3): Remove this once every integration test is migrated to Bazel
add_test(NAME integration-csi COMMAND bash -c "go test -tags integration -c ./test/ && sudo ./test.test -test.v" WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/csi)
add_test(NAME integration-dm COMMAND bash -c "go test -tags integration -c ./test/ && sudo ./test.test -test.v" WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/disk-mapper/internal)
add_test(NAME integration-license COMMAND bash -c "go test -tags integration" WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/internal/license)
1 change: 1 addition & 0 deletions internal/license/integration/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go_test(
srcs = ["license_integration_test.go"],
tags = [
"requires-network",
"integration",
],
deps = [
"//internal/license",
Expand Down

0 comments on commit 0741d54

Please sign in to comment.