Skip to content

test(seeder): prove seeder hardener S1–S10 - #3422

Merged
bpamiri merged 2 commits into
developfrom
cursor/seeder-hardener-s1-s10-5e16
Aug 25, 2026
Merged

test(seeder): prove seeder hardener S1–S10#3422
bpamiri merged 2 commits into
developfrom
cursor/seeder-hardener-s1-s10-5e16

Conversation

@bpamiri

@bpamiri bpamiri commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Why

Seeder desk IDs S1–S10 were locked. HOLD pins stay unflipped. This PR only proves current behavior so a vacuous include, a silent leftover, or a $generateTestData branch drop would fail.

S4 stays WHERE interpolation with quote-escape only (Replace(val, "'", "''")). An apostrophe in the unique value does not skip — the second seedOnce creates another row. S5 stays non-transactional: a mixed generateSeeds list can leave rows.

Scope

  • vendor/wheels/tests/specs/seederSpec.cfc — the only seeder spec file. Do not invent wheels.tests.specs.seeder.
  • Fixture files under vendor/wheels/tests/_assets/seeder/ (seeds.cfm, withenv/, stray/, includethrow/)

No production change in Seeder.cfc. Spec-only. No changelog fragment.

Out: CLI db/seed + generate/seed, docs/blog, migrator 001_seed_tag_via_model_create, blank environment throw (InvalidEnvironment its only cover ../ and /), mixed-model generate honesty (totalFailed==0 && totalCreated>0).

Already-proven, not refiled: InvalidEnvironment (../ /), MissingProperty, InvalidUniqueValue, EmptyUniqueProperties, no-files failure, partial-failure rollback, single-model generate honesty / Model.cfc skip.

Desk S1–S10

ID Status Note
S1 PROVEN Main seeds.cfm creates SeederMainOK99. totalCreated is 1, not toBeGTE(0) on an empty fixture.
S2 PROVEN withenv main + seeds/testing.cfm both create rows. environment=development runs main only — the testing include did not run.
S3 PROVEN A stray seeds/orphaned.cfm makes hasSeedFiles() true, but runSeeds(environment=testing) returns "No seed files found" and does not create the orphan row.
S4 HOLD Unique values are interpolated into WHERE with quote-escape only. An apostrophe in firstName creates, then creates again (does not skip). No parameterized flip.
S5 HOLD generateSeeds(models="Author,NoSuchModel_SeederS5") leaves the Author row. Not transactional. No wrap-in-transaction flip.
S6 PROVEN count=0: overall success=false, per-model entry success=true, no rows. count=-1: overall failure, per-model success=false, totalFailed=1, no rows.
S7 PROVEN Include-throw is caught: success=false, message includes Seed failed: and intentional include throw, first row rolled back.
S8 PROVEN request.$wheelsSeeder is left set after success, after a later run (overwritten, not deleted), and after the include-throw catch.
S9 PROVEN Default seedMappingPath is /app/db/ and seedPath is ExpandPath("/app/db/"), not only toInclude("app").
S10 PROVEN $generateTestData name and type branches: email, first/last, name/username vs displayName, phone/geo, url/password, boolean (including publishedAt before date), integer age/price/quantity/default, date, text/title/status, default string.

Verification

Command actually run (LOCKED driver — not --filter=seeder / --filter=seederSpec):

wheels test --core --ci
Running core tests (sqlite)...
5291 passed, 0 failed, 5 error(s) (16.51s)

The 5 errors are all cli.lucli.services.RewriteConfigInstaller not found (rewrite.config installer specs). Out of this seeder slice. Seeder itself is 0 fail / 0 error.

Wheels CLI 4.0.6. Lucee 7.0.0.395. sqlite.

Did not run --filter=seeder (that directory does not exist; 0-bundle fail-close). Did not invent wheels.tests.specs.seeder.

HEAD c136de20ef190d3ef6575e51bae5fef9afb66d66

Base 24cd4421ffb31634636c40d045a748222257fa34 (develop after #3421).

No closer keywords. Do not merge.

Open in Web Open in Cursor 

Pin HOLD S4/S5 and add branch-killing specs for S1/S2/S3/S6/S7/S8/S9/S10.
S4 stays WHERE interpolation with quote-escape only. S5 stays
non-transactional. No production flip.

Signed-off-by: Cursor Agent <cursoragent@cursor.com>

Co-authored-by: Peter Amiri <peter@alurium.com>
seedOnce interpolates unique values into WHERE with quote-escape only.
An apostrophe does not skip — the second seedOnce creates another row.

Signed-off-by: Cursor Agent <cursoragent@cursor.com>

Co-authored-by: Peter Amiri <peter@alurium.com>
@bpamiri
bpamiri marked this pull request as ready for review August 25, 2026 16:18
@bpamiri
bpamiri merged commit 45ac731 into develop Aug 25, 2026
14 checks passed
@bpamiri
bpamiri deleted the cursor/seeder-hardener-s1-s10-5e16 branch August 25, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants