Skip to content

Commit

Permalink
Update container acceptance tests with stdout/stderr changes (#17138)
Browse files Browse the repository at this point in the history
In #17125 jvm setup was redirected to
stderr to avoid polluting stdout. This test was actually having to do some
additional processing to parse that information. Now that we have split the
destinations the tests can be simplified to look for the data they are trying to
validate on the appropriate stream.
  • Loading branch information
donoghuc authored Feb 21, 2025
1 parent 91258c3 commit 227c0d8
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions qa/docker/shared_examples/container.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,13 @@

it 'should run with the correct version' do
console_out = exec_in_container(@container, 'logstash --version')
console_filtered = console_out.split("\n")
.delete_if do |line|
line =~ /Using LS_JAVA_HOME defined java|Using system java: /
end.join
expect(console_filtered).to match /#{version}/
expect(console_out).to match /#{version}/
end

it 'should run with the bundled JDK' do
first_console_line = exec_in_container(@container, 'logstash --version').split("\n")[0]
expect(first_console_line).to match /Using bundled JDK: \/usr\/share\/logstash\/jdk/
full_command = exec_in_container_full(@container, 'logstash --version')
std_err = full_command[:stderr].join.chomp.strip
expect(std_err).to match /Using bundled JDK: \/usr\/share\/logstash\/jdk/
end

it 'should be running an API server on port 9600' do
Expand Down

0 comments on commit 227c0d8

Please sign in to comment.