Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 17, 2025

Fix All Tests, Format and Lint ✅

All objectives completed successfully!

✅ Test Results

  • Go Unit Tests: All passing
  • JavaScript Tests: 54 files, 997 tests - all passing
  • Fuzz Tests: All passing (FuzzParseFrontmatter, FuzzExpressionParser)
  • Code Formatting: All files properly formatted
  • Code Linting: All validations passed

🔧 Changes Made

Test Fixes:

  1. pkg/workflow/js/create_code_scanning_alert.test.cjs - Updated error assertion
  2. pkg/workflow/js/create_discussion.test.cjs - Updated error assertion

Build Fix:
3. pkg/workflow/js/package-lock.json - Regenerated to fix npm ci failures

Change: Updated test assertions from core.setFailed() to core.error() to match the refactored error handling in loadAgentOutput(). Regenerated package-lock.json to ensure npm ci works correctly in CI.

📋 Root Cause Analysis

Test Failures:
The loadAgentOutput() utility function was previously refactored to:

  • Use core.error() for error logging (instead of core.setFailed())
  • Return a result object with a success flag
  • Allow calling scripts to handle errors gracefully

The tests were still expecting the old behavior (core.setFailed()), causing false failures.

npm ci Failure:
The package-lock.json file was formatted with an older npm version. When npm install/ci runs with npm 11.6.2 (Node 24), it expects the newer formatting with multi-line arrays. Regenerating the lockfile with the current npm version fixes this.

✅ Validation Summary

✅ GO UNIT TESTS        - All passing
✅ JAVASCRIPT TESTS     - 54 files, 997 tests passing  
✅ FUZZ TESTS          - All passing
✅ CODE FORMATTING     - All properly formatted
✅ CODE LINTING        - All validations passed
✅ NPM CI              - Now works correctly

Status: Ready for review and merge

Original prompt

Fix all tests, go and JavaScript, fuzz. Format and lint.


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

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan pelikhan marked this pull request as ready for review November 17, 2025 20:39
Copilot AI review requested due to automatic review settings November 17, 2025 20:39
Copilot AI changed the title [WIP] Fix and lint all tests for Go and JavaScript fuzzing Fix JavaScript test assertions for loadAgentOutput error handling Nov 17, 2025
Copilot AI requested a review from pelikhan November 17, 2025 20:40
Copilot finished work on behalf of pelikhan November 17, 2025 20:40
Copilot finished reviewing on behalf of pelikhan November 17, 2025 20:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes two JavaScript test failures by updating error handling expectations to match the refactored loadAgentOutput() utility function. The utility was previously changed to use core.error() instead of core.setFailed() for error reporting, allowing calling scripts to handle errors gracefully through a success flag pattern. The tests were still expecting the old core.setFailed() behavior, causing false failures.

Key Changes

  • Updated test assertions in create_discussion.test.cjs to expect core.error() for JSON parsing errors
  • Updated test assertions in create_code_scanning_alert.test.cjs to expect core.error() for JSON parsing errors
  • Both changes align with the loadAgentOutput() utility's refactored error handling pattern

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pkg/workflow/js/create_discussion.test.cjs Updated error handling expectation from core.setFailed() to core.error() for invalid JSON test case
pkg/workflow/js/create_code_scanning_alert.test.cjs Updated error handling expectation from core.setFailed() to core.error() for invalid JSON test case

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pelikhan
Copy link
Contributor

@pelikhan pelikhan merged commit 0b057cd into main Nov 17, 2025
134 of 143 checks passed
@pelikhan pelikhan deleted the copilot/fix-tests-go-js-fuzz branch November 17, 2025 20:50
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