diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3f8ce6f..1e4d661 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,6 +39,7 @@ jobs: - name: "Tests and Lint" run: bundle exec rake env: + TEST_TMP_DIR: ${{ vars.RUNNER_TEMP }} PGHOST: localhost PGUSER: postgres PGPASSWORD: postgres diff --git a/test/gouda/worker_test.rb b/test/gouda/worker_test.rb index 7072fe1..0adcfde 100644 --- a/test/gouda/worker_test.rb +++ b/test/gouda/worker_test.rb @@ -14,7 +14,7 @@ class GoudaWorkerTest < ActiveSupport::TestCase # We need to include the PID in the path, because we might be running # multiple test processes on the same box - and they might start touching # files from each other. - PATH_TO_TEST_FILE = -> { Tempfile.new("#{Process.pid}-gouda-worker-test-output.bin") } + PATH_TO_TEST_FILE = -> { File.expand_path(File.join(ENV["TEST_TMP_DIR"] || "tmp", "#{Process.pid}-gouda-worker-test-output.bin")) } class JobWithEnqueueKey < ActiveJob::Base self.queue_adapter = :gouda