Skip to content

Commit

Permalink
Use a build specific workdir so there's no conflict between runs (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinGreen authored Jun 17, 2022
1 parent 17ca151 commit 74669e0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/test_summary_buildkite_plugin/input.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

module TestSummaryBuildkitePlugin
module Input
WORKDIR = 'tmp/test-summary'
WORKDIR = "/tmp/test-summary/#{ENV['BUILDKITE_BUILD_ID']}"
DEFAULT_JOB_ID_REGEX = /(?<job_id>[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/

def self.create(type:, **options)
Expand All @@ -15,6 +15,10 @@ def self.create(type:, **options)
TYPES[type].new(options)
end

def self.clean_up
FileUtils.rm_rf(WORKDIR)
end

class Base
attr_reader :label, :artifact_path, :options

Expand Down
2 changes: 2 additions & 0 deletions lib/test_summary_buildkite_plugin/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ def run
else
annotate(markdown)
end

Input.clean_up
end

def annotate(markdown)
Expand Down

0 comments on commit 74669e0

Please sign in to comment.