DEV: Improve isolation and concurrency for minio-based upload specs (#29216)

- Uses a temporary, clean, per-test-process directory for minio data
- Runs a separate minio instance for each test process
- Unskips minio-based tests in CI
This commit is contained in:
David Taylor 2024-10-16 10:40:58 +01:00 committed by GitHub
parent e5f2416eff
commit 78ed8ede8a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 7 deletions

View File

@ -325,6 +325,16 @@ RSpec.configure do |config|
["discoursetest"] ["discoursetest"]
end end
) )
test_i = ENV["TEST_ENV_NUMBER"].to_i
data_dir = "#{Rails.root}/tmp/test_data_#{test_i}/minio"
FileUtils.rm_rf(data_dir)
FileUtils.mkdir_p(data_dir)
minio_runner_config.minio_data_directory = data_dir
minio_runner_config.minio_port = 9_000 + 2 * test_i
minio_runner_config.minio_console_port = 9_001 + 2 * test_i
end end
WebMock.disable_net_connect!( WebMock.disable_net_connect!(

View File

@ -144,13 +144,6 @@ module SystemHelpers
end end
def skip_unless_s3_system_specs_enabled! def skip_unless_s3_system_specs_enabled!
if ENV["CI"]
return(
skip(
"S3 system specs are temporarily disabled in this environment to address parallel spec issues",
)
)
end
if !ENV["CI"] && !ENV["RUN_S3_SYSTEM_SPECS"] if !ENV["CI"] && !ENV["RUN_S3_SYSTEM_SPECS"]
skip( skip(
"S3 system specs are disabled in this environment, set CI=1 or RUN_S3_SYSTEM_SPECS=1 to enable them.", "S3 system specs are disabled in this environment, set CI=1 or RUN_S3_SYSTEM_SPECS=1 to enable them.",