Skip to content

Fix TestStopTimeResolutionIntegration to check for correct environment variable format#2153

Merged
pelikhan merged 2 commits into
mainfrom
copilot/fix-test-suite
Oct 22, 2025
Merged

Fix TestStopTimeResolutionIntegration to check for correct environment variable format#2153
pelikhan merged 2 commits into
mainfrom
copilot/fix-test-suite

Conversation

Copilot AI commented Oct 22, 2025

Copy link
Copy Markdown
Contributor

Problem

The TestStopTimeResolutionIntegration test suite was failing because it was checking for the wrong format in compiled workflow files. The test expected to find STOP_TIME= (shell script format), but the actual implementation uses GH_AW_STOP_TIME: as a YAML environment variable in the actions/github-script@v8 step.

Root Cause

The test was written to look for shell script-style environment variable assignment:

STOP_TIME="2025-12-31 23:59:59"

However, the compiler actually generates YAML format:

env:
  GH_AW_STOP_TIME: 2025-12-31 23:59:59

This mismatch was causing all sub-tests in TestStopTimeResolutionIntegration to fail with errors like:

Compiled workflow should contain stop-time check but doesn't
Could not find STOP_TIME line in compiled workflow

Changes

Updated pkg/workflow/time_delta_integration_test.go to:

  1. Check for the correct variable name: Changed all assertions from STOP_TIME= to GH_AW_STOP_TIME:
  2. Parse YAML format correctly: Updated timestamp extraction logic to use strings.SplitN() with colon delimiter instead of looking for quoted values
  3. Update error messages: Changed all error messages to reference GH_AW_STOP_TIME for consistency

Testing

All 7 sub-tests in TestStopTimeResolutionIntegration now pass:

  • ✅ absolute stop-after unchanged
  • ✅ readable date format
  • ✅ ordinal date format
  • ✅ US date format
  • ✅ relative stop-after gets resolved
  • ✅ complex relative stop-after gets resolved
  • ✅ no stop-after specified

Full test suite passes without any failures.

Original prompt

fix test suite


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

…rmat

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issues in test suite Fix TestStopTimeResolutionIntegration to check for correct environment variable format Oct 22, 2025
Copilot AI requested a review from pelikhan October 22, 2025 19:43
@pelikhan pelikhan marked this pull request as ready for review October 22, 2025 19:46
@pelikhan pelikhan merged commit 9a5433e into main Oct 22, 2025
5 checks passed
@pelikhan pelikhan deleted the copilot/fix-test-suite branch October 22, 2025 19:46
@github-actions

Copy link
Copy Markdown
Contributor

Agentic Changeset Generator triggered by this pull request.

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