Repository navigation
Re-enable IDT complexity score tests on Windows (fixes #221) - #370
Open
anshuman83-40 wants to merge 2 commits into
Open
anshuman83-40 wants to merge 2 commits into
anshuman83-40 wants to merge 2 commits into
Conversation
The Windows failures in SynBioDex#221 were not a library bug: the CI step `echo "$IDT_CREDENTIALS" > test_secret_idt_credentials.json` ran under PowerShell on windows-latest, where `$IDT_CREDENTIALS` is an (empty) PowerShell variable rather than the environment variable. The credentials file therefore contained only a newline, producing "JSONDecodeError: Expecting value: line 2 column 1 (char 1)". Remove the win32 skips and instead skip the test class when the credentials file is absent, so local runs without IDT access skip cleanly on every platform. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jakebeal
requested changes
Oct 3, 2026
jakebeal
left a comment
Contributor
There was a problem hiding this comment.
Nice job diagnosing the problem! So far as I can tell, however, this does not actually fix the problem, it only shuts off the tests for a more principled reason. Can you find a way to allow the credentials file to actually be created?
Address review on SynBioDex#370: rather than only skipping the tests, make CI actually create the credentials file on Windows. - Run the credentials/test step with `shell: bash`, so `$IDT_CREDENTIALS` expands to the environment variable instead of an empty PowerShell variable on windows-latest (the root cause of SynBioDex#221). - Run external-api-tests on ubuntu, windows and macOS, with `max-parallel: 1` so the IDT service is never hit concurrently (SynBioDex#368). - Skip the tests when the credentials file is empty as well as missing, since secrets are not passed to pull requests from forks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
|
Thanks! Good point. I've updated the workflow so the credentials file is actually created on every platform: the step now runs with |
This branch has not been deployed
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.
Root cause
The Windows failures in #221 were caused by CI, not by the library. When the
tests ran on
windows-latest, the stepecho "$IDT_CREDENTIALS" > test_secret_idt_credentials.jsonran under PowerShell, the default shell on Windows runners. In PowerShell,
$IDT_CREDENTIALSis a PowerShell variable (undefined, so empty), not theenvironment variable (
$env:IDT_CREDENTIALS). The credentials file thereforeheld only a newline. Reading it in text mode gives exactly the reported error:
(Reproduced locally: a file containing only
\r\n, opened in text mode, raises this exact error.)Change
skipIf(sys.platform == 'win32')decorators.skipUnless(CREDENTIALS_FILE.exists()). Contributors without IDTcredentials now see the tests skipped instead of a
FileNotFoundError, on every platform.Testing
postpatched to returnthe scores stored in
Comparison_file_Complexity_Scores.nt), bothtest_IDT_calculate_complexity_scoreandtest_commandlinepass.Note: the
external-api-testsjob now runs only onubuntu-latest(where the default shell isbash), so CI is not affected. If Windows is ever added to that job, the credentials step should
use
shell: bash.