Conversation
- Fix plugin-lifecycle.test.ts to use an isolated temp C8CTL_DATA_DIR, preventing global state pollution between concurrent test files - Add --test-concurrency=1 to test:integration to serialize file execution, eliminating race conditions from concurrent integration test runs - Add tests/utils/chaos-runner.mjs: seeded Fisher-Yates shuffle for test files, enabling reproducible chaos testing - Add test:integration:chaos and test:unit:chaos npm scripts - CI: fail-fast: false so all matrix jobs complete and failures are visible - CI: use test:integration:chaos for integration tests so every run exercises a different file order, probing for ordering dependencies Co-authored-by: vobu <6573426+vobu@users.noreply.github.com>
|
@copilot merge in current
|
…stabilize-ci-test-suites
- tests/unit/list-table-formatting.test.ts: 18 unit tests for Key-column
fallback and field-formatting logic in process-definitions, user-tasks,
incidents, and jobs list commands (mirrors process-instances.test.ts pattern)
- tests/integration/list-commands.test.ts: all list and get CLI commands
tested via spawnSync with every flag combination:
list pi — --id / --state / --all / --sortBy+--asc/--desc / --limit
/ --between / --dateField / text header check
list pd — --sortBy+--asc/--desc / --limit / text header check
list ut — --state / --all / --sortBy+--asc/--desc / --limit / text headers
list inc — --state / --processInstanceKey / --sortBy+--asc/--desc
/ --limit / text headers
list jobs — --state / --type / --sortBy+--asc/--desc / --limit
/ --between (8.9+ skip) / text headers
get pi — plain + --variables
get pd — plain + --xml
get inc — plain
search pi/ut/inc/jobs/variables — CLI surface + sort flags
Function-level tests for listProcessDefinitions, getProcessDefinition,
listUserTasks, listIncidents, getIncident, listJobs using console.log
capture to verify actual output content
Co-authored-by: vobu <6573426+vobu@users.noreply.github.com>
Done in commit
Also includes function-level tests for |
|
@copilot check why gh actions fail and fix. further, tests should avoid mocking process.exit with a throw. Instead, they should either: |
…ss.exit mock-with-throw pattern Root cause of 26 CI failures: - logger.table() in JSON mode serializes display column names as keys (Key, 'Process ID', 'Process Instance', State, Type, etc.) not the raw API field names (processDefinitionKey, processInstanceKey, state, type) - before() was extracting items[0].processDefinitionKey etc. → all undefined - search CLI assertions used it.state, it.type, it.processDefinitionId etc. → all undefined, causing assertion failures Fixes in tests/integration/list-commands.test.ts: - before(): use items[0].Key for all key extraction - before(): use items[0]['Process Instance'] for processInstanceKey in incidents - before(): use jobs[0].State (not j.state) for job state check - before(): add assert.ok guards so setup failures are immediately visible - search CLI tests: fix all field names to match table column names - remove function-level test section (violates project guideline to only use CLI commands in integration tests; also fragile due to global logger mode state) process.exit mock-with-throw pattern removed: - tests/unit/completion.test.ts: replaced process.exit stub with spawnSync (runs CLI as real subprocess, asserts on status/stderr/stdout) - tests/integration/profile-switching.test.ts: replaced process.exit mock with spawnSync-based test that asserts list pi exits with code 1 Co-authored-by: vobu <6573426+vobu@users.noreply.github.com>
Fixed in commit CI failures (26 failing tests) — root cause was wrong JSON field names throughout
Specific fixes:
The function-level test section (
|
plugin-lifecycle.test.tsisolationmaintests/unit/list-table-formatting.test.tstests/integration/list-commands.test.ts(comprehensive CLI flag coverage)Key/'Process ID'/StatenotprocessDefinitionKey/etc.) inlist-commands.test.tsbefore()and search assertionsprocess.exitmock-with-throw incompletion.test.ts→spawnSyncwith exit-code assertionprocess.exitmock-with-throw inprofile-switching.test.ts→spawnSyncwith exit-code assertionOriginal prompt
Start implementation
The user has attached the following file paths as relevant context:
- .github/copilot-instructions.md
[Chronological Review: The conversation began with the user requesting an investigation into flaky GitHub Actions and the need to stabilize CI by analyzing past runs and ensuring test suites are isolated. The user then specified not to invest in fixing the `release.yaml` file as it is being handled in parallel. The most recent context involved the user working on the `package.json` file in the `c8ctl` repository.][Intent Mapping:
release.yamlas it is being addressed elsewhere.][Technical Inventory:
c8ctlmainpackage.json[Code Archaeology:
package.jsonc8ctlrepository.[Progress Assessment:
[Context Validation: All critical information for continuation is captured, including user goals regarding CI stability and the specific files being worked on.]
[Recent Commands Analysis:
package.jsonfile.1. Conversation Overview: - Primary Objectives: - "gh actions have become flaky. your goal is to make the CI more stable." - "make sure, test suites are properly isolated." - "introduce some chaos testing, e.g. by running suites in different orders." - "don't invest in fixing the releas.yaml - this is taken care of in parallel." - Session Context: The user is focused on improving the stability of CI processes in the `c8ctl` repository, specifically addressing flaky GitHub Actions and ensuring test suite isolation. - User Intent Evolution: The user initially sought to stabilize CI, then clarified not to focus on `release.yaml`, indicating a prioritization of tasks.- Technical Foundation:
- Repository:
- Current Branch:
- File:
- Purpose: Manages dependencies and scripts for the project.
- Codebase Status:
- File Name:
- Purpose: Important for managing project dependencies and scripts.
- Current State: User is currently working on this file.
- Key Code Segments: Not specified in the conversation.
- Dependencies: Related to the overall project setup.
- Problem Resolution:
- Issues Encountered: Flaky GitHub Actions causing CI instability.
- Solutions Implemented: User has not yet implemented solutions but has outlined steps for investigation and chaos testing.
- Debugging Context: Ongoing investigation into CI failures and test suite isolation.
- Lessons Learned: Need for chaos testing to identify stability issues.
- Progress Tracking:
- Completed Tasks: Identification of CI issues and need for test suite isolation.
- Partially Complete Work: Implementation of chaos testing and further investigation into CI failures is pending.
- Validated Outcomes: No outcomes validated yet.
- Active Work State:
- Current Focus: Investigating CI stability and working on
- Recent Context: User has been discussing CI improvements and isolation of test suites.
- Working Code: No specific code snippets were discussed recently.
- Immediate Context: User was addressing CI stability and test suite isolation.
- Recent Operations:
- Last Agent Commands: No specific commands executed; focus was on user requests.
- Tool Results Summary: No tool results generated; conversation focused on user directives.
- Pre-Summary State: User was actively discussing CI stability and working on
- Operation Context: User's requests w...
c8ctlmainpackage.jsonpackage.jsonpackage.json.package.json.Created from VS Code.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.