DEV: Re-enable minio specs by pre-installing minio binary before test run (#24050)

This fixes a similar issue to 8b3eca0 where an Errno::ETXTBSY error was raised because the minio_runner gem was trying to install the binary across multiple processes in rspec. If we just make sure the latest version is installed before the tests run, this shouldn't happen, since MinioRunner.start will not do any further attempts at installation if the latest version is installed.
This commit is contained in:
Martin Brennan 2023-10-24 12:43:14 +10:00 committed by GitHub
parent 9e4a72945c
commit d5e8bd790b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 5 deletions

View File

@ -220,6 +220,10 @@ jobs:
if: matrix.build_type == 'system'
run: bin/ember-cli --build
- name: Ensure latest minio binary installed for System Tests
if: matrix.build_type == 'system'
run: bundle exec ruby script/install_minio_binaries.rb
- name: Core System Tests
if: matrix.build_type == 'system' && matrix.target == 'core'
run: RAILS_ENABLE_TEST_LOG=1 RAILS_TEST_LOG_LEVEL=error PARALLEL_TEST_PROCESSORS=4 bin/turbo_rspec --use-runtime-info --profile=50 --verbose --format documentation spec/system

View File

@ -11,7 +11,7 @@
@disabled={{this.uploading}}
@action={{this.chooseImage}}
@title="user.change_avatar.upload_title"
class="btn-default"
class="btn-default avatar-uploader__button"
data-uploaded={{this.customAvatarUploaded}}
data-avatar-upload-id={{this.uploadedAvatarId}}
/>

View File

@ -199,8 +199,6 @@ module SystemHelpers
end
def skip_unless_s3_system_specs_enabled!
skip("(martin) temporarily skipping minio tests because of parralel binary issues")
if !ENV["CI"] && !ENV["RUN_S3_SYSTEM_SPECS"]
skip(
"S3 system specs are disabled in this environment, set CI=1 or RUN_S3_SYSTEM_SPECS=1 to enable them.",

View File

@ -110,7 +110,13 @@ describe "Uploading files in the composer to S3", type: :system do
# Extra wait time is added because the job can slow down the processing of the request.
img = first_post_img(wait: 10)
expect(img["src"]).not_to include("/secure-uploads")
# At first the image will be secure when created via the composer, usually the
# CookedPostProcessor job fixes this but running it immediately when creating the
# post doesn't work in the test, so we need to rebake here to get the correct result.
expect(page).to have_css("img[src*='secure-uploads']")
Post.last.rebake!
expect(page).not_to have_css("img[src*='secure-uploads']", wait: 5)
topic = topic_page.current_topic
expect(topic.first_post.uploads.first.secure).to eq(false)
end

View File

@ -22,7 +22,7 @@ describe "Uploading files in the composer to S3", type: :system do
attach_file(File.absolute_path(file_from_fixtures("logo.jpg"))) do
find("#avatar-uploader").click
end
expect(page).to have_css(".avatar-uploader label[data-uploaded]")
expect(page).to have_css(".avatar-uploader .avatar-uploader__button[data-uploaded]")
modal.click_primary_button
expect(modal).to be_closed
expect(page).to have_css(