Skip to content

WA-VERIFY-082: Harden script/default_appraisal_zeitwerk_check (cd pattern + Redis wait + RAILS_ENV) #1068

@kitcommerce

Description

@kitcommerce

Summary

PR #1055 (WA-VERIFY-077) created script/default_appraisal_zeitwerk_check. The Wave 2 test-quality reviewer identified three non-blocking but recommended improvements:

  1. Fragile cd ../../.. — if a zeitwerk:check call fails mid-way, the working directory is wrong for subsequent engines. Use subshell pattern instead: (cd "$engine/test/dummy" && bin/rails zeitwerk:check)

  2. Missing Redis wait — the service-readiness block waits for ES and Mongo but not Redis. zeitwerk:check may false-fail if Redis isn't up (Sidekiq/ActionCable initializers can fail).

  3. RAILS_ENV not exported — defaults to development if CI doesn't set it. Should be explicit: export RAILS_ENV=test.

Approach

# Current fragile pattern
for engine in core admin storefront; do
  cd "$engine/test/dummy" && bin/rails zeitwerk:check || exit 1
  cd ../../..
done

# Safer subshell pattern
for engine in core admin storefront; do
  (cd "$engine/test/dummy" && RAILS_ENV=test bin/rails zeitwerk:check) || exit 1
done

Acceptance Criteria

  • Engine loops use subshell (cd ...) pattern
  • RAILS_ENV=test set explicitly
  • Redis wait added to service-readiness block (matching ES/Mongo pattern)
  • Script still exits non-zero on any zeitwerk error

Client Impact

None — CI-only script.

Related

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions