Repository navigation
Conversation
Updates test suite to use PostgreSQL in CI environments while maintaining SQLite for local development. This provides better production parity in automated tests and catches database-specific issues earlier. Changes: - Configure DATABASE_URL in test_helper.rb (Postgres in CI, SQLite locally) - Update all test files to use ENV['DATABASE_URL'] instead of hardcoded SQLite - Add proper database cleanup in setup/teardown methods - Configure CI workflow to use PostgreSQL service - Update README with instructions for running tests with both databases The test suite remains backward compatible - developers can continue using SQLite by default or opt into PostgreSQL testing via DATABASE_URL. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The theforeman/actions reusable workflow doesn't support a database parameter, which caused the initial CI run to fail with a startup error. This commit replaces the reusable workflow with a custom test job that properly sets up PostgreSQL as a service container. Changes: - Add PostgreSQL 15 service container with health checks - Set DATABASE_URL environment variable for tests - Use ruby/setup-ruby with bundler-cache for faster builds - Keep rubocop job using theforeman/actions reusable workflow Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Set CI=true and RACK_ENV=test explicitly - Add step to list test files before running - Add echo statements to show test execution progress This will help diagnose why not all tests appear to be running. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Verify PostgreSQL connection before running tests - Attempt to load each test file individually to identify failures - Continue on error to see which files fail to load This will help identify why only 1 of 3 test files is running. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The require statements inside the class bodies were preventing the test classes from being fully defined, causing those tests to be skipped. Moving them to the top of the file (like integration_test.rb) fixes this. This should make all tests run instead of just integration_test.rb. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Remove extra empty line at the beginning of the class body. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Tests are now fixed, so remove the debugging steps and run tests directly. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
sjha4
marked this pull request as draft
September 3, 2026 18:34
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.
Updates test suite to use PostgreSQL in CI environments while maintaining SQLite for local development. This provides better production parity in automated tests and catches database-specific issues earlier.
Changes:
The test suite remains backward compatible - developers can continue using SQLite by default or opt into PostgreSQL testing via DATABASE_URL.