Skip to content

Commit 9870913

Browse files
Testclaude
andcommitted
test(ci): enhance auth flow test with config creation validation
Enhanced the CI test to validate the FULL installer flow: 1. NScurl POST → get auth response 2. nsJSON::Set /file → parse auth response 3. nsJSON::Get → extract tokens 4. nsJSON::Set /value `{}` → create NEW config (THE BUG SITE) 5. nsJSON::Serialize → verify output This catches the exact bug that was fixed in v8.4.38 where nsJSON state from auth affected subsequent config creation. The test now matches the installer pattern exactly: no intermediate error checks, only final result validation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 35e2b2c commit 9870913

2 files changed

Lines changed: 36 additions & 4 deletions

File tree

.github/workflows/release-mcpb.yml

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ jobs:
402402
default { Write-Error "FAILED: Unknown error $($process.ExitCode)"; exit 1 }
403403
}
404404
405-
- name: Test FULL auth flow (NScurl POST + nsJSON parse + token extraction)
405+
- name: Test FULL auth flow (NScurl POST + nsJSON parse + token extraction + config creation)
406406
shell: pwsh
407407
env:
408408
CIDX_SERVER_URL: ${{ secrets.CIDX_TEST_SERVER_URL }}
@@ -500,8 +500,33 @@ jobs:
500500
StrCmp $3 "" fail_token
501501
StrCmp $3 "null" fail_token
502502
503+
; =====================================================
504+
; STEP 6-8: TEST CONFIG CREATION (matches CreateMCPBConfig)
505+
; This tests the EXACT bug we fixed - nsJSON state after auth
506+
; =====================================================
507+
508+
; Step 6: Initialize new JSON object and set values
509+
; NOTE: Don't check intermediate errors - nsJSON sets false positives
510+
; Only verify final serialized result (matches installer pattern)
511+
FileWrite $8 "Step 6: Testing config creation after auth...$\r$\n"
512+
nsJSON::Set /value `{}`
513+
nsJSON::Set `server_url` /value `"__SERVER_URL__"`
514+
nsJSON::Set `access_token` /value `"$2"`
515+
nsJSON::Set `refresh_token` /value `"$3"`
516+
517+
; Step 7: Serialize and verify final result only
518+
FileWrite $8 "Step 7: Serializing config JSON...$\r$\n"
519+
nsJSON::Serialize /PRETTY /UNICODE
520+
Pop $4
521+
522+
FileWrite $8 "Serialized config: [$4]$\r$\n"
523+
524+
; Step 8: Verify serialization produced output
525+
StrCmp $4 "" fail_config
526+
FileWrite $8 "Step 8: Config creation verified successfully!$\r$\n"
527+
503528
; SUCCESS!
504-
FileWrite $8 "=== SUCCESS: Full auth flow completed! ===$\r$\n"
529+
FileWrite $8 "=== SUCCESS: Full auth flow + config creation completed! ===$\r$\n"
505530
FileClose $8
506531
Delete "$1"
507532
SetErrorLevel 0
@@ -517,6 +542,12 @@ jobs:
517542
FileWrite $8 "FAIL: Token extraction failed (empty or null)$\r$\n"
518543
FileClose $8
519544
SetErrorLevel 4
545+
Goto done
546+
547+
fail_config:
548+
FileWrite $8 "FAIL: Config creation failed (serialization returned empty)$\r$\n"
549+
FileClose $8
550+
SetErrorLevel 5
520551
521552
done:
522553
SectionEnd
@@ -551,10 +582,11 @@ jobs:
551582
}
552583
553584
switch ($process.ExitCode) {
554-
0 { Write-Host "SUCCESS: Full authentication flow verified against real CIDX server!" }
585+
0 { Write-Host "SUCCESS: Full authentication flow + config creation verified against real CIDX server!" }
555586
2 { Write-Error "FAILED: NScurl POST request failed"; exit 1 }
556587
3 { Write-Error "FAILED: nsJSON parsing failed"; exit 1 }
557588
4 { Write-Error "FAILED: Token extraction failed"; exit 1 }
589+
5 { Write-Error "FAILED: Config creation failed after auth (the bug this test catches)"; exit 1 }
558590
default { Write-Error "FAILED: Unknown error $($process.ExitCode)"; exit 1 }
559591
}
560592

src/code_indexer/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
HNSW graph indexing (O(log N) complexity).
77
"""
88

9-
__version__ = "8.4.38"
9+
__version__ = "8.4.39"
1010
__author__ = "Seba Battig"

0 commit comments

Comments
 (0)