Open Thorn1089 opened 6 years ago
This is a good idea. I generally achieve this with the build configured to set the tags up (Gradle build configures the system properties on the test task), but maybe something like this would be easier to configure.
The
@PactBroker
annotation allows me to either hard-code tags, or provide them using a system property. The system property lets me specify different tags at runtime, which is great for doing things like testing bothdevelop
andmaster
branches on my CI server.However, it'd be even better if I could specify tags dynamically at runtime. As a specific example, I'd like to write a JUnit test that would determine the current Git branch at runtime and add that branch name to the tags to be tested against (in addition to latest stable develop and master tags). I can manually specify these things in places like Eclipse run configurations or on the command line but that gets tedious.
I'm not sure how this would work in practice - perhaps something similar to the
HttpTarget
proposal allowing a callback to be provided to determine a dynamic port at runtime, where there could be aPactBroker
rule instead of an annotation that accepts either static values, property keys, or callbacks?