summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Pitino <fpitino@gitlab.com>2019-06-14 16:44:19 +0100
committerFabio Pitino <fpitino@gitlab.com>2019-06-14 16:48:33 +0100
commit6ab9a9df6fd9e3701956ec222ff2e8f60e1e940b (patch)
tree05c520ad053d7cb8db66c79c729c030b6d00d5f8
parent83aa0fb5867c10d9d96e069836241e567b8ac508 (diff)
downloadgitlab-ce-6ab9a9df6fd9e3701956ec222ff2e8f60e1e940b.tar.gz
Fix integration specs for tracing
-rw-r--r--lib/gitlab/ci/ansi2html.rb2
-rw-r--r--spec/controllers/projects/jobs_controller_spec.rb2
-rw-r--r--spec/support/shared_examples/ci_trace_shared_examples.rb4
3 files changed, 5 insertions, 3 deletions
diff --git a/lib/gitlab/ci/ansi2html.rb b/lib/gitlab/ci/ansi2html.rb
index 875f9dcecdb..dafa0087f3f 100644
--- a/lib/gitlab/ci/ansi2html.rb
+++ b/lib/gitlab/ci/ansi2html.rb
@@ -155,7 +155,9 @@ module Gitlab
stream.each_line do |line|
s = StringScanner.new(line)
+
until s.eos?
+
if s.scan(Gitlab::Regex.build_trace_section_regex)
handle_section(s)
elsif s.scan(/\e([@-_])(.*?)([@-~])/)
diff --git a/spec/controllers/projects/jobs_controller_spec.rb b/spec/controllers/projects/jobs_controller_spec.rb
index 490e9841492..0dabe27977a 100644
--- a/spec/controllers/projects/jobs_controller_spec.rb
+++ b/spec/controllers/projects/jobs_controller_spec.rb
@@ -540,7 +540,7 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['id']).to eq job.id
expect(json_response['status']).to eq job.status
- expect(json_response['html']).to eq('BUILD TRACE')
+ expect(json_response['html']).to eq('<span class="">BUILD TRACE</span>')
end
end
diff --git a/spec/support/shared_examples/ci_trace_shared_examples.rb b/spec/support/shared_examples/ci_trace_shared_examples.rb
index db935bcb388..f985b2dcbba 100644
--- a/spec/support/shared_examples/ci_trace_shared_examples.rb
+++ b/spec/support/shared_examples/ci_trace_shared_examples.rb
@@ -5,11 +5,11 @@ shared_examples_for 'common trace features' do
end
it "returns formatted html" do
- expect(trace.html).to eq("12<br>34")
+ expect(trace.html).to eq("<span class=\"\">12<br/><span class=\"\">34</span></span>")
end
it "returns last line of formatted html" do
- expect(trace.html(last_lines: 1)).to eq("34")
+ expect(trace.html(last_lines: 1)).to eq("<span class=\"\">34</span>")
end
end