dzbarsky / rules_itest

Bazel rules for integration testing services
MIT License
18 stars 6 forks source link

Problems with env vars and service_test #13

Closed darkrift closed 5 months ago

darkrift commented 5 months ago

service_test has 2 problems:

  1. It's not passing the env vars defined on that rule to the test
  2. It overrides the env vars of the <lang>_test rule itself

See the following patch for an example failing_test.patch

21:26:42 rlavoie ~/rlavoie/dzbarsky/rules_itest/tests (master) $ bazel test //...
...
//go_service:go_env_var_test                                             PASSED in 0.1s
//go_service:env_vars                                                    FAILED in 0.1s
  /private/var/tmp/_bazel_rlavoie/3c18c5f8f0c86cd505b7b7b2032578c8/execroot/_main/bazel-out/darwin_arm64-fastbuild/testlogs/go_service/env_vars/test.log
//go_service:env_vars_override                                           FAILED in 0.1s
  /private/var/tmp/_bazel_rlavoie/3c18c5f8f0c86cd505b7b7b2032578c8/execroot/_main/bazel-out/darwin_arm64-fastbuild/testlogs/go_service/env_vars_override/test.log
dzbarsky commented 5 months ago

Fixed in https://github.com/dzbarsky/rules_itest/commit/3180e81dbfa8e11f530b1940f0eb1b7156035d36