Commit ccc4d5e
authored
Fix intermittent
The `profile.d/` scripts test asserts on captured `run_multi` command output
using an exact match against a heredoc. The platform log stream that captures
the output occasionally appends an extra trailing newline, which intermittently
breaks these exact assertions.
For example:
https://github.com/heroku/heroku-buildpack-python/actions/runs/27144980449/job/80156740097?pr=2099#step:5:628
```
Failures:
1) .profile.d/ scripts sets the required run-time env vars
Failure/Error:
expect(output).to eq(<<~OUTPUT)
Python buildpack: Detected 512 MB available memory and 8 CPU cores.
Python buildpack: Skipping automatic configuration of WEB_CONCURRENCY since it's already set.
DYNO_RAM=512
WEB_CONCURRENCY=999
OUTPUT
expected: "Python buildpack: Detected 512 MB available memory and 8 CPU cores.\nPython buildpack: Skipping auto...matic configuration of WEB_CONCURRENCY since it's already set.\nDYNO_RAM=512\nWEB_CONCURRENCY=999\n"
got: "Python buildpack: Detected 512 MB available memory and 8 CPU cores.\nPython buildpack: Skipping auto...tic configuration of WEB_CONCURRENCY since it's already set.\nDYNO_RAM=512\nWEB_CONCURRENCY=999\n\n"
(compared using ==)
# ./spec/hatchet/profile_d_scripts_spec.rb:128:in 'block (4 levels) in <top (required)>'
# ./vendor/bundle/ruby/4.0.0/gems/heroku_hatchet-8.0.6/lib/hatchet/app.rb:255:in 'block in Hatchet::App#run_multi'
```
Adds a `normalize_trailing_newlines` spec helper that collapses any trailing
newlines down to a single one, and applies it to the exact-match assertions in
the test. This absorbs the spurious trailing newline whilst still asserting on
the rest of the output exactly.
GUS-W-22900269.profile.d/ scripts test failure from extra trailing newline (#2102)1 parent 689b417 commit ccc4d5e
2 files changed
Lines changed: 15 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
| 128 | + | |
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
65 | 71 | | |
66 | 72 | | |
67 | 73 | | |
| |||
0 commit comments