Skip to content

Set up DB for tests as part of default Rake task #374

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 9, 2024

Conversation

andyw8
Copy link
Contributor

@andyw8 andyw8 commented May 9, 2024

The first time someone cloned and runs the tests, they'll get a confusing error because the dB doesn't yet exist.

I originally considered checking if the DB exists first, but creating is very quick so I don't think that's necessary.

(for sqlite3 at least, db:setup is idempotent so there's no problem with it being re-run. We don't care about the data in the DB).

@andyw8 andyw8 added the chore Chore task label May 9, 2024
@andyw8 andyw8 marked this pull request as ready for review May 9, 2024 14:14
@andyw8 andyw8 requested a review from a team as a code owner May 9, 2024 14:14
@andyw8 andyw8 requested review from st0012 and vinistock May 9, 2024 14:14
@@ -30,4 +30,4 @@ end

RubyLsp::CheckDocs.new(FileList["#{__dir__}/lib/ruby_lsp/**/*.rb"], FileList["#{__dir__}/misc/**/*.gif"])

task default: :test
task default: [:"db:setup", :test]
Copy link
Contributor Author

@andyw8 andyw8 May 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous we were running db:migrate too but since db:setup calls db:schema:load, this isn't necessary.

@andyw8 andyw8 merged commit 23edfb1 into main May 9, 2024
@andyw8 andyw8 deleted the andyw8/setup-db-for-tests branch May 9, 2024 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Chore task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants