Class ConformanceRunner
java.lang.Object
codes.grow.packages.skywalking.testing.ConformanceRunner
Runs the shared conformance scenarios (
conformance/scenarios/*.json, SPEC section 6)
against targets supplied by a service's integration test.
ConformanceReport report = ConformanceRunner.builder()
.target("core", s -> client)
.target("secrets", s -> provider)
.capabilities("write", "delete", "version")
.build()
.run();
report.assertPassed();
Only categories with a target run. Category operations are plugged in through ConformanceOps: CoreOps always, the secrets / logging / tracing operations when the
package contains them, plus anything passed to ConformanceRunner.Builder.register(codes.grow.packages.skywalking.testing.ConformanceOps).
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic ConformanceRunner.Builderbuilder()Starts a builder withCoreOpsand the built-in category operations registered.run()Runs every selected scenario.runScenario(Scenario scenario) Runs one scenario.Returns the scenarios of the categories that have a target, sorted by id.static Stringsubstitute(String text, Map<String, String> vars) Replaces${name}placeholders; unknown names are kept as they are.static com.fasterxml.jackson.databind.JsonNodesubstituteNode(com.fasterxml.jackson.databind.JsonNode node, Map<String, String> vars) Substitutes placeholders in every string (and object key) of a JSON tree.
-
Field Details
-
DEFAULT_PREFIX
Default value of${prefix}.- See Also:
-
DEFAULT_POLL_TIMEOUT
How longlistServicessteps are repeated until their expectation passes. -
DEFAULT_POLL_INTERVAL
Pause between repeated steps.
-
-
Method Details
-
builder
Starts a builder withCoreOpsand the built-in category operations registered.- Returns:
- a new builder
-
scenarios
Returns the scenarios of the categories that have a target, sorted by id.- Returns:
- the scenarios
- Throws:
UncheckedIOException- when the directory cannot be read
-
run
Runs every selected scenario.- Returns:
- the report
-
runScenario
Runs one scenario.- Parameters:
scenario- the scenario- Returns:
- its result
-
substitute
Replaces${name}placeholders; unknown names are kept as they are.- Parameters:
text- text with placeholdersvars- variables- Returns:
- the substituted text
-
substituteNode
public static com.fasterxml.jackson.databind.JsonNode substituteNode(com.fasterxml.jackson.databind.JsonNode node, Map<String, String> vars) Substitutes placeholders in every string (and object key) of a JSON tree.- Parameters:
node- JSON treevars- variables- Returns:
- a substituted copy
-