Skip to content

similar_searcher: fix test failures by adding missing fixtures #168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 1, 2025

Conversation

otegami
Copy link
Member

@otegami otegami commented Apr 1, 2025

Problem

The tests are failed as follows.

E

Error:
FullTextSearch::SimilarSearchIssueTest#test_same_structure_on_issue:
ActiveRecord::RecordInvalid: Validation failed: Tracker cannot be blank, Priority cannot be blank, Status cannot be blank
    test/object_helpers.rb:107:in `generate!'
    plugins/full_text_search/test/unit/full_text_search/similar_search_issue_test.rb:20:in `block in test_same_structure_on_issue'
    plugins/full_text_search/test/unit/full_text_search/similar_search_issue_test.rb:19:in `test_same_structure_on_issue'

rails test plugins/full_text_search/test/unit/full_text_search/similar_search_issue_test.rb:17

ref: https://github.com/clear-code/redmine_full_text_search/actions/runs/14164033981/job/39674095903?pr=166#logs

Cause

The test failures occurred because the necessary fixtures for enumerations, issue statuses, and trackers were not loaded.
As a result, when generating issues during tests, mandatory fields were missing, which led to validation errors.

Solution

We add the missing fixture declarations in the test file.

## Problem

The tests are failed as follows.

```
E

Error:
FullTextSearch::SimilarSearchIssueTest#test_same_structure_on_issue:
ActiveRecord::RecordInvalid: Validation failed: Tracker cannot be blank, Priority cannot be blank, Status cannot be blank
    test/object_helpers.rb:107:in `generate!'
    plugins/full_text_search/test/unit/full_text_search/similar_search_issue_test.rb:20:in `block in test_same_structure_on_issue'
    plugins/full_text_search/test/unit/full_text_search/similar_search_issue_test.rb:19:in `test_same_structure_on_issue'

rails test plugins/full_text_search/test/unit/full_text_search/similar_search_issue_test.rb:17
```

ref: https://github.com/clear-code/redmine_full_text_search/actions/runs/14164033981/job/39674095903?pr=166#logs

## Cause

The test failures occurred because the necessary fixtures for enumerations,
issue statuses, and trackers were not loaded. As a result, when generating
issues during tests, mandatory fields were missing, which led to validation
errors.

## Solution

We add the missing fixture declarations in the test file.
@kou kou merged commit caaa433 into clear-code:master Apr 1, 2025
17 of 24 checks passed
@otegami otegami deleted the similar-search-fix-missing-fixtures branch April 1, 2025 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants