$ npx @apollo/federation-subgraph-compatibility@2.0.0 docker --help
Usage: fedtest docker [options]
Start supergraph using Docker Compose
Options:
--compose <docker-compose.yaml> Path to docker compose file
--debug debug mode with extra log info
--failOnRequired boolean flag to indicate whether any failing required test should fail the script.
--failOnWarning boolean flag to indicate whether any failing test should fail the script.
--format <json|markdown> optional output file format (choices: "json", "markdown", default: "markdown")
-h, --help display help for command
--path <path> GraphQL endpoint path (default: "")
--port <port> HTTP server port (default: "4001")
--quiet suppress logging to minimum
--schema <schema.graphql> Path to schema file
...and thought "I want my script to fail on both required tests and for any test", and proceeded to run with --failOnRequired --failOnWarning. However, I discovered that --failOnWarning is ignored in this case.
If --failOnRequired is set, --failOnWarning is silently ignored. Since --failOnWarning is a stricter flag, it seems like it should be checked first. (And I realize now that I don't need to provide both.)
Thanks for raising this! Indeed the checks should be reversed so it works consistently if both flags are provided. Do you mind opening up a PR with a fix?
I read the help docs:
...and thought "I want my script to fail on both required tests and for any test", and proceeded to run with
--failOnRequired --failOnWarning
. However, I discovered that--failOnWarning
is ignored in this case.It looks like the culprit is here:
https://github.com/apollographql/apollo-federation-subgraph-compatibility/blob/e952694dccc80584c18366766e459fc7d86f206f/packages/compatibility/src/compatibilityTest.ts#L61-L67
If
--failOnRequired
is set,--failOnWarning
is silently ignored. Since--failOnWarning
is a stricter flag, it seems like it should be checked first. (And I realize now that I don't need to provide both.)