Skip to content

Fix CI: don't rely on request.MODULE_NAME in test harness module activation - #57

Merged
lmajano merged 6 commits into
developmentfrom
claude/loving-mayer-8sjso9
Sep 15, 2026
Merged

lmajano merged 6 commits into
developmentfrom
claude/loving-mayer-8sjso9

Conversation

@lmajano

@lmajano lmajano commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Summary

CI was failing on every engine (lucee@6, adobe@2023, adobe@2025, boxlang@1, boxlang-cfml@1) and every ColdBox version (^8 and be) with cascading Instance not found: 'DiskService@cbfs' errors (166 of 193 specs erroring). Root cause traced from the CI logs:

  1. DiskServiceSpec runs first and passes.
  2. LocalDiskSpec runs next, triggering a ColdBox reinit (this.loadColdbox = true). This throws a GLOBAL BUNDLE EXCEPTION: key [MODULE_NAME] doesn't exist in the request scope, from test-harness/config/Coldbox.cfc's cbLoadInterceptorHelpers, which does registerAndActivateModule(moduleName = request.MODULE_NAME, ...).
  3. request.MODULE_NAME is only ever set in Application.cfc's pseudo-constructor (a single physical request). ColdBox's BaseTestCase clears/bypasses the request scope between virtual-app reinits (its reset()/beforeTests() machinery), so that key is gone by the time this interceptor fires again on LocalDiskSpec's reinit — this is inherent ColdBox test-harness isolation behavior, not new/broken cbfs code.
  4. The failed reinit aborts module registration, so cbfs never gets re-activated, and every subsequent bundle (S3DiskSpec, RamDiskSpec, ModuleIntegrationSpec) fails to resolve DiskService@cbfs.

Fix

Hardcode the module name in cbLoadInterceptorHelpers instead of reading it from the volatile request scope, matching the literal Application.cfc already uses (request.MODULE_NAME = "cbfs").

Test plan

  • CI run on this PR is green across all engines/ColdBox versions

🤖 Generated with Claude Code

https://claude.ai/code/session_01MY8vKDaEubRApVMT9BXSYk


Generated by Claude Code

ColdBox's BaseTestCase clears/bypasses the request scope between
virtual-app reinits, so request.MODULE_NAME (set only in Application.cfc's
pseudo-constructor) can be gone by the time cbLoadInterceptorHelpers fires
on a reinit. This threw a GLOBAL BUNDLE EXCEPTION during the LocalDiskSpec
reinit in CI, leaving the cbfs module never re-registered and cascading
into "Instance not found: DiskService@cbfs" across almost every remaining
spec/engine. Hardcode the module name instead, matching the literal
Application.cfc already uses.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MY8vKDaEubRApVMT9BXSYk
@github-actions

github-actions Bot commented Sep 14, 2026

Copy link
Copy Markdown

lucee@6 ColdBox ^8 Test Results

  1 files  ±0    5 suites  ±0   5m 10s ⏱️ + 5m 4s
280 tests ±0  280 ✅ +72  0 💤 ±0  0 ❌  - 4 
284 runs  ±0  280 ✅ +72  4 💤 ±0  0 ❌  - 4 

Results for commit 37d83c7. ± Comparison against base commit f41955c.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Sep 14, 2026

Copy link
Copy Markdown

lucee@6 ColdBox be Test Results

  1 files  ±0    5 suites  ±0   12s ⏱️ +5s
280 tests ±0  280 ✅ +72  0 💤 ±0  0 ❌  - 4 
284 runs  ±0  280 ✅ +72  4 💤 ±0  0 ❌  - 4 

Results for commit 37d83c7. ± Comparison against base commit f41955c.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Sep 14, 2026

Copy link
Copy Markdown

boxlang-cfml@1 ColdBox ^8 Test Results

  1 files  ±0    5 suites  ±0   12s ⏱️ -1s
280 tests ±0  280 ✅ +51  0 💤 ±0  0 ❌  - 23 
284 runs  ±0  280 ✅ +51  4 💤 ±0  0 ❌  - 23 

Results for commit 37d83c7. ± Comparison against base commit f41955c.

♻️ This comment has been updated with latest results.

@github-actions

Copy link
Copy Markdown

boxlang@1 ColdBox ^8 Test Results

  1 files  ±0    5 suites  ±0   6s ⏱️ ±0s
277 tests ±0  203 ✅ ±0  0 💤 ±0  6 ❌ ±0  68 🔥 ±0 
284 runs  ±0  203 ✅ ±0  7 💤 ±0  6 ❌ ±0  68 🔥 ±0 

For more details on these failures and errors, see this check.

Results for commit 98c43c4. ± Comparison against base commit 19753f9.

@github-actions

github-actions Bot commented Sep 14, 2026

Copy link
Copy Markdown

boxlang@1 ColdBox ^8 Test Results

  1 files  ±0    5 suites  ±0   6s ⏱️ ±0s
277 tests ±0  204 ✅ ±0  0 💤 ±0  6 ❌ ±0  67 🔥 ±0 
284 runs  ±0  204 ✅ ±0  7 💤 ±0  6 ❌ ±0  67 🔥 ±0 

For more details on these failures and errors, see this check.

Results for commit 37d83c7. ± Comparison against base commit f41955c.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Sep 14, 2026

Copy link
Copy Markdown

boxlang@1 ColdBox be Test Results

  1 files  ±0    5 suites  ±0   6s ⏱️ ±0s
277 tests ±0  204 ✅ ±0  0 💤 ±0  6 ❌ ±0  67 🔥 ±0 
284 runs  ±0  204 ✅ ±0  7 💤 ±0  6 ❌ ±0  67 🔥 ±0 

For more details on these failures and errors, see this check.

Results for commit 37d83c7. ± Comparison against base commit f41955c.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Sep 14, 2026

Copy link
Copy Markdown

boxlang-cfml@1 ColdBox be Test Results

  1 files  ±0    5 suites  ±0   13s ⏱️ +4s
280 tests ±0  280 ✅ +51  0 💤 ±0  0 ❌  - 23 
284 runs  ±0  280 ✅ +51  4 💤 ±0  0 ❌  - 23 

Results for commit 37d83c7. ± Comparison against base commit f41955c.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Sep 14, 2026

Copy link
Copy Markdown

adobe@2023 ColdBox be Test Results

  1 files  ±0    5 suites  ±0   13s ⏱️ +4s
277 tests ±0  274 ✅ +49  0 💤 ±0  3 ❌  - 21 
284 runs  ±0  274 ✅ +49  7 💤 ±0  3 ❌  - 21 

For more details on these failures, see this check.

Results for commit 37d83c7. ± Comparison against base commit f41955c.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Sep 14, 2026

Copy link
Copy Markdown

adobe@2023 ColdBox ^8 Test Results

  1 files  ±0    5 suites  ±0   12s ⏱️ +5s
277 tests ±0  277 ✅ +50  0 💤 ±0  0 ❌  - 22 
284 runs  ±0  277 ✅ +50  7 💤 ±0  0 ❌  - 22 

Results for commit 37d83c7. ± Comparison against base commit f41955c.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Sep 14, 2026

Copy link
Copy Markdown

adobe@2025 ColdBox ^8 Test Results

  1 files  ±0    5 suites  ±0   11s ⏱️ +4s
277 tests ±0  277 ✅ +50  0 💤 ±0  0 ❌  - 22 
284 runs  ±0  277 ✅ +50  7 💤 ±0  0 ❌  - 22 

Results for commit 37d83c7. ± Comparison against base commit f41955c.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Sep 14, 2026

Copy link
Copy Markdown

adobe@2025 ColdBox be Test Results

  1 files  ±0    5 suites  ±0   11s ⏱️ +3s
277 tests ±0  277 ✅ +50  0 💤 ±0  0 ❌  - 22 
284 runs  ±0  277 ✅ +50  7 💤 ±0  0 ❌  - 22 

Results for commit 37d83c7. ± Comparison against base commit f41955c.

♻️ This comment has been updated with latest results.

adobe/s3mock renamed initialBuckets to
COM_ADOBE_TESTING_S3MOCK_STORE_INITIAL_BUCKETS (deprecated in S3Mock
4.5.0, removed thereafter). Pulling the image unpinned meant CI silently
stopped creating the cbfs-test bucket, so every S3 disk test failed
immediately with "NoSuchBucket" regardless of any application code.
Pin the image and use the current env var name.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MY8vKDaEubRApVMT9BXSYk
Fixes the cfformat check failure introduced by the recent
cleanDirectory() arrow-function refactor.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MY8vKDaEubRApVMT9BXSYk
Ran the project's own cfformat tool (matching CI's format:check step)
to fix the method-chain wrapping the previous semicolon fix didn't
address.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MY8vKDaEubRApVMT9BXSYk
…mayer-8sjso9

# Conflicts:
#	models/providers/RamProvider.cfc
#	test-harness/config/Coldbox.cfc
@lmajano
lmajano merged commit f75f759 into development Sep 15, 2026
24 of 33 checks passed
lmajano added a commit that referenced this pull request Sep 15, 2026
* change to minor release due to return type changes createFromFile

* Issue #41 - upload now returns file object

* bump action versions

* Version bump [ci skip]

* add boxlang to matrix

* fix misspelled module name in server-boxlang@1.json

* ci: enable workflow dispatch for triggering boxlang tests and reinstall commandbox-boxlang

* ci: use ubuntu-24.04 runner

* fix version mistake

* fix wrong matrix variable name

* boxlang certs

* s3sdk

* make server configs unique

* BL compat testing updates

* Apply cfformat changes

* readme updates

* fixes for env not being sourced in for S3 mock

* fix unclosed quote

* try pinning commandbox version

* manually remove coldbox virtual app as the subsequent tests are not loading coldbox correctly

* Apply cfformat changes

* try re-creating virtual app

* Remove DiskServiceSpec until COLDBOX-1294 is fixed

* add opens and jre versions

* remove lucee 6 from non-experimental

* Update Router.cfc

* Update server-boxlang-cfml@1.json

* remove unnecessary empty bytes write

* revert BL tests to be until 1.7 is out

* bump coldbox version and BL stable version

* update workflows to use latest updates

* add latest adobe and boxlang prime

* change default acl due to aws issues

* this should be fixed

* all tests are green now

* Apply cfformat changes

* more updates

* update lucee

* aws issue

* adding some adobe issues

* jre 21

* more updates

* issues boxlang prime

* more issue updates

* Apply cfformat changes

* more fixes

* cb8 +

* bump s3sdk

* Fix CI: don't rely on request.MODULE_NAME in test harness module activation (#57)

* fix: don't rely on request.MODULE_NAME in test harness module activation

ColdBox's BaseTestCase clears/bypasses the request scope between
virtual-app reinits, so request.MODULE_NAME (set only in Application.cfc's
pseudo-constructor) can be gone by the time cbLoadInterceptorHelpers fires
on a reinit. This threw a GLOBAL BUNDLE EXCEPTION during the LocalDiskSpec
reinit in CI, leaving the cbfs module never re-registered and cascading
into "Instance not found: DiskService@cbfs" across almost every remaining
spec/engine. Hardcode the module name instead, matching the literal
Application.cfc already uses.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MY8vKDaEubRApVMT9BXSYk

* fix: use current S3Mock env var to seed the initial test bucket

adobe/s3mock renamed initialBuckets to
COM_ADOBE_TESTING_S3MOCK_STORE_INITIAL_BUCKETS (deprecated in S3Mock
4.5.0, removed thereafter). Pulling the image unpinned meant CI silently
stopped creating the cbfs-test bucket, so every S3 disk test failed
immediately with "NoSuchBucket" regardless of any application code.
Pin the image and use the current env var name.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MY8vKDaEubRApVMT9BXSYk

* fix: add missing semicolon in RamProvider cleanDirectory closure

Fixes the cfformat check failure introduced by the recent
cleanDirectory() arrow-function refactor.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MY8vKDaEubRApVMT9BXSYk

* style: apply cfformat to RamProvider.cfc

Ran the project's own cfformat tool (matching CI's format:check step)
to fix the method-chain wrapping the previous semicolon fix didn't
address.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MY8vKDaEubRApVMT9BXSYk

---------

Co-authored-by: Claude <noreply@anthropic.com>

* performance tuning

* more fine tuning for tests

* Apply cfformat changes

* oops

---------

Co-authored-by: Github Actions <info@ortussolutions.com>
Co-authored-by: Oscar Tisnado <68830577+otisnado@users.noreply.github.com>
Co-authored-by: Luis Majano <lmajano@gmail.com>
Co-authored-by: jclausen <5255645+jclausen@users.noreply.github.com>
Co-authored-by: lmajano <137111+lmajano@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
@lmajano
lmajano deleted the claude/loving-mayer-8sjso9 branch September 15, 2026 11:18
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