Copilot commented on code in PR #13837:
URL: https://github.com/apache/trafficserver/pull/13837#discussion_r4276233642
##########
src/proxy/http/remap/unit-tests/test_NextHopStrategyFactory.cc:
##########
@@ -40,6 +40,18 @@
SCENARIO("factory tests loading yaml configs", "[loadConfig]")
{
+ GIVEN("Loading a strategy.yaml with a bare '#include' directive.")
+ {
+ REQUIRE_NOTHROW(YAML::LoadFile(TS_SRC_DIR
"/include-missing-strategy.yaml"));
+ NextHopStrategyFactory nhf(TS_SRC_DIR "/include-missing-strategy.yaml");
+
+ THEN("the bare directive is rejected and no strategies load")
+ {
+ REQUIRE(nhf.strategies_loaded == false);
+ REQUIRE(nhf.strategyInstance("strategy-1") == nullptr);
+ }
+ }
Review Comment:
`TS_SRC_DIR` is used unconditionally in this new test block, but the
surrounding file already indicates it may be optional (there is an existing
`#ifdef TS_SRC_DIR` later). If `TS_SRC_DIR` is not defined in some build
configurations, this block will fail to compile. Wrap this new `GIVEN` block in
the same `#ifdef TS_SRC_DIR` pattern (or otherwise provide a fallback path) to
keep the unit tests buildable across configurations.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]