Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Improve tests result consistency #581

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
justin808 merged 16 commits into master from reduce-test-failures
Jan 5, 2024
Merged

Improve tests result consistency #581

justin808 merged 16 commits into master from reduce-test-failures
Jan 5, 2024

Conversation

@ahangarha
Copy link
Contributor

@ahangarha ahangarha commented Dec 31, 2023
edited
Loading

The changes in rescript_spec.rb and turbo_spec.rb improve our test accuracy.

(削除) The changes in spec/system/* fix the test failure when these tests run before others (leading to their failure). (削除ここまで)

(削除) I am not sure why we have tests in the system directory that should have the type of feature, but it fixes our issues. I need to study deeper to understand what is happening under the hood. (削除ここまで)

(削除) Should I move these feature tests into the feature directory, or we can keep them this way for now? (削除ここまで)

This change is Reviewable

@ahangarha ahangarha changed the title (削除) Reduces the tests false failure frequencies (削除ここまで) (追記) WIP - Reduces the tests false failure frequencies (追記ここまで) Dec 31, 2023
In this commit, a deply is put between UI interaction and database
check. This, fixed false positive test pass for not updating database on
empty form submission.
@ahangarha ahangarha changed the title (削除) WIP - Reduces the tests false failure frequencies (削除ここまで) (追記) Improve tests result consistency (追記ここまで) Jan 1, 2024
sleep(1)

# This will ensure we wait enough for the changes to be applied
expect(page).to have_text("")
Copy link
Member

@justin808 justin808 Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ahangarha, this is a very strange assertion!

Please add self-review comments for WTF's like this!

CC: @Judahmeek

Copy link
Contributor Author

@ahangarha ahangarha Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I mentioned in the comment above that line, we need to put some delay before getting assertion for comment count change. Before I fixed it with sleep but that is not efficient. This assertion makes it more efficient.

Copy link
Member

@justin808 justin808 Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expect page to display the new comment in the right format block (not in the input field).

ahangarha reacted with thumbs up emoji
Copy link
Contributor Author

@ahangarha ahangarha Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already had a test to ensure the new comment is displayed on the page. This test was to ensure the comment was added to the database.

Now, we combine them into one test with multiple assertions.

initital_comment_count = Comment.all.count
new_comment_count = initital_comment_count + 1
fill_in author_field, with: comment.author
fill_in text_field, with: comment.text
Copy link
Member

@justin808 justin808 Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sure the text is some unique value

Copy link
Contributor Author

@ahangarha ahangarha Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When this test runs, we have a fresh database.

sleep(1)

# This will ensure we wait enough for the changes to be applied
expect(page).to have_text("")
Copy link
Member

@justin808 justin808 Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expect page to display the new comment in the right format block (not in the input field).

ahangarha reacted with thumbs up emoji
sleep(1)

# This will ensure we wait enough for the changes to be applied
expect(page).to have_text("")
Copy link
Member

@justin808 justin808 Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@ahangarha see my changes.

@justin808 justin808 merged commit 0c254ee into master Jan 5, 2024
@justin808 justin808 deleted the reduce-test-failures branch January 5, 2024 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Judahmeek Judahmeek Awaiting requested review from Judahmeek

@justin808 justin808 Awaiting requested review from justin808

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /