Repository navigation
Conversation
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.
When the tests run in a process that bloks-server started, such as an agent's turn, they inherit
BLOKS_LOCAL_KEY=1, which bin/bloks-server.mjs sets in its own environment, and the test harness passes it on to the server it starts. That server then treats every request without that start's key as a stranger's. The harness's readiness check carries no key, so unless the test turned pairing on,/api/healthanswers 403 and the harness gives up after 30 seconds withharness exited null, before the test begins.The harness already clears the other variables bloks-server sets, such as
BLOKS_LOOPBACK_ONLY. This clearsBLOKS_LOCAL_KEYthe same way. A test that wants the key still passes it inextraEnv, which comes last, as the two key tests intest/local-key.test.tsdo.Checked:
test/local-key.test.tssetsBLOKS_LOCAL_KEY=1in the test process and expects an ordinary server without a key. On main it fails at the harness's 30-second bound; with this change it passes.BLOKS_LOCAL_KEY=1inherited, these pass with this change:test/local-key.test.ts(5 tests, including the two that turn the key on and check stranger, owner, stale key and agent credential),test/telegram-full-access.test.ts(11),test/plan-remote.test.ts(3) andtest/mcp-apps-remote.test.ts(3). With main's harness and the same inherited value, the two key-less tests intest/local-key.test.ts(the existing one and the new one) and the firsttelegram-full-accesstest fail to start.Tests that start a server themselves rather than through the harness are unchanged.