Add option to pass in variables into executed tests.
Skycfg supports passing in variables during evaluation, but does not have a similar option to do so when evaluating tests. This works fine for tests on helper functions (where you'd have the caller pass relevant values as parameters rather than accessing the global ctx.vars directly) but meant you can't test the output of skycfg evaluation.
For example, if I wanted to assert that my proto's f_string is only 100 characters long:
Previously this would fail when running test_main because ctx.vars["name"] is not available. With this pr, it is possible to pass in the same variables when running tests.
Tests
Updated tests to skycfg_test to consider this case
Summary
Add option to pass in variables into executed tests.
Skycfg supports passing in variables during evaluation, but does not have a similar option to do so when evaluating tests. This works fine for tests on helper functions (where you'd have the caller pass relevant values as parameters rather than accessing the global
ctx.vars
directly) but meant you can't test the output of skycfg evaluation.For example, if I wanted to assert that my proto's
f_string
is only 100 characters long:Previously this would fail when running
test_main
becausectx.vars["name"]
is not available. With this pr, it is possible to pass in the same variables when running tests.Tests
Updated tests to skycfg_test to consider this case