Project

General

Profile

Actions

Bug #22544

open

Rails config loader should not ignore database name given in config file, even in test mode

Added by Tom Clegg about 1 month ago. Updated about 1 month ago.

Status:
New
Priority:
Normal
Assigned To:
-
Category:
API
Target version:
-
Story points:
-

Description

This code effectively means the test suite fails if the test database name is anything other than arvados_test:

# Special case for test database where there's no database.yml,                                                                                                                              
# because the Arvados config.yml doesn't have a concept of multiple                                                                                                                          
# rails environments.                                                                                                                                                                        
#                                                                                                                                                                                            
if ::Rails.env.to_s == "test" && db_config["test"].nil?
  $arvados_config["PostgreSQL"]["Connection"]["dbname"] = "arvados_test" 
end

Since this code was written, run_test_server.py (and install guides, etc.) moved database configs from {railsroot}/config/database.yml to config.yml, so the Rails config loader no longer needs to second-guess the database name, or even read database.yml at all.

We should remove this unneeded code from the Rails config loader so it just does what config.yml says to do.


Related issues 1 (0 open1 closed)

Related to Arvados - Bug #22406: lib/controller/localdb tests build arvados-server, run it in debian:11 container, assume too much glibc compatibilityResolvedBrett SmithActions
Actions #1

Updated by Tom Clegg about 1 month ago

  • Related to Bug #22406: lib/controller/localdb tests build arvados-server, run it in debian:11 container, assume too much glibc compatibility added
Actions #2

Updated by Brett Smith about 1 month ago

  • Target version deleted (Development 2025-02-12)
  • Assigned To deleted (Tom Clegg)

Tom Clegg wrote:

We should remove this unneeded code from the Rails config loader so it just does what config.yml says to do.

This got done in b23567171b16e4d6718dd78ea57bb25bc4b06a76. It would be good to test that the rest of the stack works with a custom database name, but the biggest obstacle is out of the way now.

Actions

Also available in: Atom PDF