プロジェクト

全般

プロフィール

Vote #80345

完了

Fix test failure due to missing call to set_tmp_attachments_directory

Admin Redmine さんが4年以上前に追加. 4年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Code cleanup/refactoring_30
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
30
version_id:
127
issue_org_id:
32122
author_id:
362529
assigned_to_id:
332
comments:
4
status_id:
5
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

https://www.redmine.org/builds/logs/build_trunk_postgresql_ruby-2.4_583.html

...F

Failure:
AttachmentsControllerTest#test_download_should_assign_content_type_if_blank [/var/lib/jenkins/workspace/trunk/DATABASE_ADAPTER/postgresql/RUBY_VER/ruby-2.4/test/functional/attachments_controller_test.rb:345]:
Expected response to be a <2XX: success>, but was a <404: Not Found>

bin/rails test test/functional/attachments_controller_test.rb:339

.........................................................................................................F

Failure:
Redmine::ApiTest::AttachmentsTest#test_GET_/attachments/thumbnail/:id_should_return_the_thumbnail [/var/lib/jenkins/workspace/trunk/DATABASE_ADAPTER/postgresql/RUBY_VER/ruby-2.4/test/integration/api_test/attachments_test.rb:83]:
Expected response to be a <2XX: success>, but was a <404: Not Found>

bin/rails test test/integration/api_test/attachments_test.rb:80

...F

Failure:
Redmine::ApiTest::AttachmentsTest#test_GET_/attachments/:id.xml_for_image_should_include_thumbnail_url [/var/lib/jenkins/workspace/trunk/DATABASE_ADAPTER/postgresql/RUBY_VER/ruby-2.4/test/integration/api_test/attachments_test.rb:54]:
Expected response to be a <2XX: success>, but was a <404: Not Found>
Response body: 

bin/rails test test/integration/api_test/attachments_test.rb:52

....................................................................................................................................................................................................................................................................F

Failure:
ApplicationHelperTest#test_attached_images_should_read_later [/var/lib/jenkins/workspace/trunk/DATABASE_ADAPTER/postgresql/RUBY_VER/ruby-2.4/test/helpers/application_helper_test.rb:249]:
Expected false to be truthy.

bin/rails test test/helpers/application_helper_test.rb:245

.........................................................................................................F

Failure:
AttachmentsTest#test_download_should_set_sendfile_header [/var/lib/jenkins/workspace/trunk/DATABASE_ADAPTER/postgresql/RUBY_VER/ruby-2.4/test/integration/attachments_test.rb:153]:
Expected response to be a <2XX: success>, but was a <404: Not Found>

bin/rails test test/integration/attachments_test.rb:148

I think the reason why the test failed is that Attachments under test/fixtures/files/ is missing.
I think I should call to @set_tmp_attachments_directory@ . I attached a patch.


journals

--------------------------------------------------------------------------------
LGTM. Setting the target version to 4.2.0.

@set_tmp_attachments_directory@ and @set_fixtures_attachments_directory@ are methods which change @Attachment.storage_path@ during tests.

If a test method which creates/deletes attachments, @set_tmp_attachments_directory@ has to be called at the beginning of the method in order not to destroy the contents in @test/fixtures/files@ directory. Some test methods which uses files in @test/fixtures/files@ call @set_fixtures_attachments_directory@ in order to set @Attachment.storage_path@ to @test/fixtures/files@. Those test methods should call @set_tmp_attachments_directory@ at the end. Otherwise, you may observe some test failures.

This patch ensures calling @set_tmp_attachments_directory@ in some tests, in order to fix test failures which occurs occasionally.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Committed the patch. Thank you for investigating the test failure.
--------------------------------------------------------------------------------

Admin Redmine さんが4年以上前に更新

  • カテゴリCode cleanup/refactoring_30 にセット
  • 対象バージョン4.1.0_127 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0