Commit ddc88db
authored
test_console_adapter: fix test failures caused by console gem update (#5360)
**Which issue(s) this PR fixes**:
Fixes #
**What this PR does / why we need it**:
The `console` gem changed its duration log format from ` 0.0s` to `
0.00s` in version 1.35.0 (socketry/console@14cf37d).
This caused assertion failures in `ConsoleAdapterTest` when running on
newer Ruby versions (3.3+).
This patch will fix following error
```
$ bundle exec ruby -I"test:lib" test/log/test_console_adapter.rb
Loaded suite test/log/test_console_adapter
Started
F
==========================================================================================================================================
Failure: test_args[debug](ConsoleAdapterTest)
test/log/test_console_adapter.rb:59:in 'ConsoleAdapterTest#test_args'
56: fatal: :fatal)
57: def test_args(level)
58: @console_logger.send(level, "subject", 1, 2, 3)
=> 59: assert_equal([
60: "#{@timestamp_str} [#{level}]: 0.0s: subject\n" +
61: " | 1\n" +
62: " | 2\n" +
<["2023-01-01 15:32:41 +0000 [debug]: 0.0s: subject\n" +
" | 1\n" +
" | 2\n" +
" | 3\n"]> expected but was
<["2023-01-01 15:32:41 +0000 [debug]: 0.00s: subject\n" +
" | 1\n" +
" | 2\n" +
" | 3\n"]>
diff:
? ["2023-01-01 15:32:41 +0000 [debug]: 0.00s: subject\n" +
" | 1\n" +
" | 2\n" +
" | 3\n"]
==========================================================================================================================================
F
...
```
**Docs Changes**:
**Release Note**:
Signed-off-by: Shizuo Fujita <fujita@clear-code.com>1 parent f36b379 commit ddc88db
1 file changed
Lines changed: 13 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
16 | 23 | | |
17 | 24 | | |
18 | 25 | | |
| |||
45 | 52 | | |
46 | 53 | | |
47 | 54 | | |
48 | | - | |
| 55 | + | |
49 | 56 | | |
50 | 57 | | |
51 | 58 | | |
| |||
57 | 64 | | |
58 | 65 | | |
59 | 66 | | |
60 | | - | |
| 67 | + | |
61 | 68 | | |
62 | 69 | | |
63 | 70 | | |
| |||
76 | 83 | | |
77 | 84 | | |
78 | 85 | | |
79 | | - | |
| 86 | + | |
80 | 87 | | |
81 | 88 | | |
82 | 89 | | |
| |||
94 | 101 | | |
95 | 102 | | |
96 | 103 | | |
97 | | - | |
| 104 | + | |
98 | 105 | | |
99 | 106 | | |
100 | 107 | | |
| |||
109 | 116 | | |
110 | 117 | | |
111 | 118 | | |
112 | | - | |
113 | | - | |
| 119 | + | |
| 120 | + | |
114 | 121 | | |
115 | 122 | | |
116 | 123 | | |
| |||
0 commit comments