Add test_seeds generator for automatic E2E seed data#1
Open
fez3d wants to merge 3 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
agent_e2e:test_seedsthat reads all models anddb/schema.rb, calls OpenAI to generatedb/test_seeds.rbwith realistic seed data for E2E testingqa@example.com/Password123!) is always created directly by the generator, independent of the AI response — with automatic detection of Devise,has_secure_password, andconfirmabledb/seeds.rbbin/e2enow requiresdb/test_seeds.rbto exist; if missing, it stops and shows the user exactly what to do based on whetherOPENAI_API_KEYis configured or nottest_seedsgenerator, keeping responsibilities separatedChanges
test_seeds/test_seeds_generator.rbdb/test_seeds.rbinstall/install_generator.rbagent_e2e:test_seeds, removes manual seed instructions from next stepsinstall/templates/e2etest_seeds.rb, exits with actionable instructions if missingREADME.mdSEED_AI_MODELconfig, and troubleshootingTest plan
bin/rails generate agent_e2e:installwithOPENAI_API_KEYset — verifydb/test_seeds.rbis generated with QA user and model databin/rails generate agent_e2e:installwithout API key — verify it skips seed generation gracefully and shows instructionsbin/rails generate agent_e2e:test_seedsindependently — verify it generates/overwritesdb/test_seeds.rbbin/e2ewithoutdb/test_seeds.rb— verify it exits with correct instructionsbin/e2ewithdb/test_seeds.rbpresent — verify it seeds and runs tests normallypassword_confirmationandconfirmed_atare included in QA user block