Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 26, 2025

Two test failures were blocking CI: TestTrialModeCompilation/Trial_Mode incorrectly validated checkout steps, and TestWriteSafeInputsFiles failed due to missing embedded JavaScript content.

Changes

Trial mode test fix (pkg/workflow/trial_mode_test.go)

  • Search for "Checkout repository" step by name before validating token presence
  • Previously stopped at first checkout action (the sparse-checkout "Checkout actions folder" step)
  • Token is correctly present in second checkout step, test now validates the right one

Re-embed safe-inputs JavaScript files (pkg/workflow/js.go)

  • Add //go:embed directives for 9 safe-inputs .cjs files
  • Update getter functions to return embedded content instead of empty strings
  • Commit 2d4c6ce removed embedded scripts for runtime loading, but TestWriteSafeInputsFiles expects embedded content
//go:embed js/read_buffer.cjs
var readBufferScript string

//go:embed js/mcp_http_transport.cjs
var mcpHTTPTransportScript string

// ... 7 more files

func GetReadBufferScript() string {
    return readBufferScript  // was: return ""
}

Import cleanup

  • Remove unused imports from logs_firewall_parse_test.go and logs_parse_test.go
  • Preserve imports needed by active tests
Original prompt

Fix tests

Custom agent used: ci-cleaner
Tidies up the repository CI state by formatting sources, running linters, fixing issues, running tests, and recompiling workflows


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI self-assigned this Dec 26, 2025
Copilot AI and others added 2 commits December 26, 2025 06:25
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…fix trial mode test

- Fixed TestTrialModeCompilation/Trial_Mode by updating test logic to look for "Checkout repository" step specifically instead of stopping at first checkout
- Fixed TestWriteSafeInputsFiles by re-embedding safe-inputs JavaScript files that were removed in previous commit
- Added //go:embed directives for: read_buffer.cjs, mcp_http_transport.cjs, safe_inputs_config_loader.cjs, mcp_server_core.cjs, safe_inputs_validation.cjs, mcp_logger.cjs, mcp_handler_shell.cjs, mcp_handler_python.cjs, safe_inputs_mcp_server_http.cjs
- Updated getter functions to return embedded content instead of empty strings
- Removed unused imports from logs_firewall_parse_test.go and logs_parse_test.go (but kept imports needed by active tests)

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issues in existing tests Fix test failures: trial mode checkout validation and embedded JavaScript files Dec 26, 2025
Copilot AI requested a review from pelikhan December 26, 2025 07:05
@pelikhan pelikhan closed this Dec 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants