Commit Graph

11 Commits

Author SHA1 Message Date
Yasuo Honda
fc375d63c4 Address ApplicationTests::DBConsoleTest failures against asserion enabled Ruby
https://buildkite.com/rails/rails-nightly/builds/191#018dc3d1-902c-4b01-a82c-b662ebdbe567/1182-1188

Increasing timeout value from 10 to 100 for assert_output method addresses these failures.

- Ruby built with debug options that takes more than 20 seconds and gets failed
Here, the Ruby is built with these options:

```
cppflags="-DENABLE_PATH_CHECK=0 -DRUBY_DEBUG=1" optflags="-O3 -fno-inline"
```

```ruby
$ ruby -v
ruby 3.4.0dev (2024-02-20T11:52:09Z master c22cb960cf) [x86_64-linux]
$ time bin/test test/application/dbconsole_test.rb
Run options: --seed 5685

F

Failure:
ApplicationTests::DBConsoleTest#test_use_value_defined_in_environment_file_in_database_yml [test/console_helpers.rb:19]:
"sqlite>" expected, but got:

.
Expected "" to include "sqlite>".

bin/test test/application/dbconsole_test.rb:21

F

Failure:
ApplicationTests::DBConsoleTest#test_respect_environment_option [test/console_helpers.rb:19]:
"sqlite>" expected, but got:

.
Expected "" to include "sqlite>".

bin/test test/application/dbconsole_test.rb:43

Finished in 10.105668s, 0.1979 runs/s, 0.3958 assertions/s.
2 runs, 4 assertions, 2 failures, 0 errors, 0 skips

real    0m21.031s
user    0m8.665s
sys     0m2.286s
$
```

- Ruby built without debug options that finishes within second.

```ruby
$ ruby -v
ruby 3.4.0dev (2024-02-20T11:52:09Z master c22cb960cf) [x86_64-linux]
$ time bin/test test/application/dbconsole_test.rb
Run options: --seed 1479

..

Finished in 5.463076s, 0.3661 runs/s, 1.0983 assertions/s.
2 runs, 6 assertions, 0 failures, 0 errors, 0 skips

real    0m9.942s
user    0m2.288s
sys     0m2.173s
$
```
2024-02-20 22:26:16 +09:00
David Heinemeier Hansson
d18fc32999
Use storage/ instead of db/ for sqlite3 db files (#46699)
* Use storage/ instead of db/ for sqlite3 db files

db/ should be for configuration only, not data. This will make it easier to mount a single volume into a container for testing, development, and even sqlite3 in production.
2022-12-12 08:32:12 +01:00
yuuji.yaginuma
5b0b1ee8fd Use correct variable
Follow up of 3e81490717a314437f9123d86fa3e9dc55558e95.
2018-09-11 07:06:30 +09:00
Rafael Mendonça França
3e81490717
Remove all references to slave in the codebase 2018-09-10 16:31:32 -04:00
bogdanvlviv
ff67743fb2
Remove redundant execution of Dir.chdir(app_path) { } in railties' tests 2017-10-08 23:04:04 +03:00
Pat Allan
acea68de02 Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
Sean Griffin
a1fa2fbaf1 Merge pull request #29931 from y-yagi/extract_assert_output_and_available_pty_to_module
Extract `assert_output` and `available_pty?` into `ConsoleHelpers` module
2017-07-25 11:46:20 -04:00
Sean Griffin
b691a946ba Fix dbconsole test when tempdir is a long path
The output of `.databases` in SQLite will truncate to a certain size.
This causes the test to fail when run locally from a mac, or anything
which has a tempdir with more than a few characters. This pragma has
the same output, but presented as a normal query, meaning no truncation
will occur.
2017-07-25 08:12:11 -04:00
yuuji.yaginuma
af4cef024b Extract assert_output and available_pty? into ConsoleHelpers module
We define almost the same method with multiple tests. Therefore, it extract
into module.
2017-07-25 15:01:33 +09:00
yuuji.yaginuma
8be50181d3 Set RAILS_ENV before load application file
Since #29725, load application file when `dbconsole` command is executed.
However, if do not set `RAILS_ENV` before reading the application file,
can not connect to the env specified in option, so added the setting
of `RAILS_ENV`.
2017-07-17 09:11:21 +09:00
yuuji.yaginuma
e12715bfd5 Load environment file in dbconsole command
Currently the environment file is not loaded in `dbconsole` command.
Therefore, for example, if use encrypted secrets values in database.yml,
`read_encrypted_secrets` will not be true, so the value can not be
used correctly.

Fixes #29717
2017-07-09 13:18:56 +09:00