Repository navigation
Conversation
TestSuiteInteractor built its Orchestra without the API key, so every AI command failed with "MAESTRO_CLOUD_API_KEY is not available" whenever maestro test took the suite path: a directory or several flows, a single flow with --format junit/html, or --shard-all. The single-flow path already passed it. The test runs a suite against FakeDriver with the AI endpoint stubbed, and checks the request carries the key.
authToken was computed when TestCommand was constructed, before picocli sets --api-key, so the flag never reached AI commands and the key came from MAESTRO_CLOUD_API_KEY or the stored login instead. It's computed lazily now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
AI commands (
assertWithAI,assertNoDefectsWithAI,extractTextWithAI) fail with "MAESTRO_CLOUD_API_KEYis not available" whenevermaestro testruns more than one flow, or a single flow with--format junit/htmlor--shard-all, which covers most CI setups. Separately,--api-keynever reached AI commands at all, so the key came fromMAESTRO_CLOUD_API_KEYor the stored login instead, even in a single-flow run. Fixes #3051.Approach
TestSuiteInteractornow takes the API key and passes it toOrchestra, the same wayMaestroCommandRunnerdoes for a single flow. That covers all three suite-path triggers listed on the issue.TestCommand.authTokenwas computed in the constructor, before picocli sets--api-key. It's lazy now.One commit per fix. I also added
maestro-testas a test dependency ofmaestro-cliso the suite runner can be tested againstFakeDriver.Not covered: the MCP run tool builds its own
Orchestrawithout a key too (McpViewerOrchestra). Happy to do that separately if it should have one.Verification
TestSuiteInteractorTestruns a flow withassertWithAIthrough the suite runner againstFakeDriver, with the AI endpoint stubbed byMockWebServer, and checks the request carriesBearer <key>. Onmainit fails with the missing-key error.TestCommandTestcases:--api-keywins overMAESTRO_CLOUD_API_KEY, and the env var is used when the flag isn't passed. The first fails onmain.:maestro-cli:testpasses (168), and each commit passes on its own.MAESTRO_CLOUD_API_URLpointed at a local stub and dummy keys:maestro test …main--format junit--api-key--api-keyvalue sent--api-key--api-keyvalue sent--shard-allgoes through the sameTestSuiteInteractorcall, but I didn't run it.