Conversation
|
This looks like the right long-term API and would let downstream users remove wrapper patches. Before merging, could these two cases be covered explicitly?
Would you also consider keeping service_test for one deprecation release? Migrating a large set of existing wrappers atomically is fairly expensive. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace
service_testwithextend_test_rule(parent), which extends an existing Starlark test rule withservicesand runs its inherited executable throughsvcinit. The extended rule preserves the parent rule's providers, runfiles, test environment, and test classification; its initializer addsservicestodataso Bazel also preserves service coverage. Becausectx.super()returns a rawDefaultInfowithout an exposed executable or populatedfiles_to_run, the implementation recovers parent executables from declared outputs or runfiles, including Windows JavaScript launchers.Define inherited Go, shell, JavaScript, and
native_testrules intests/test_rules.bzl; replace two-targetservice_testdeclarations with single test targets; reuse@rules_itest//:exit0for hygiene and startup/shutdown tests; restore separate test and task environment coverage; and updatedocs/itest.md. Parent test rules must exposedata.Validation
bazel test //...intests/: 44 tests passed.bazel test //...in the repository root: 2 tests passed.bazel coverage --enable_runfiles --instrument_test_targets --instrumentation_filter=//go_service,//so_reuseport,//test_env --combined_report=lcov //so_reuseport:so_reuseport_test //test_env:env_specified_in_task: both tests passed;go_service/main.go,so_reuseport/so_reuseport_test.go, andtest_env/env_test.goappear in the combined LCOV report.buildifier -mode=checkon every changed Starlark and BUILD file.