Skip to content
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

test: check IPR search results in HTML with whitespace ignored #7921

Merged
merged 1 commit into from
Sep 12, 2024

Conversation

microamp
Copy link
Collaborator

@microamp microamp commented Sep 11, 2024

fixes the issue raised in #7836 (comment)

It's still important to group

  • a document
  • and its relationship with
  • another document

together and test them as a whole for each assertion in the test.

All that was needed was to

  1. revert 6e4c803, and
  2. add html=True to each of the self.assertContains calls

Edit: See the official documentation on assertContains below.

https://docs.djangoproject.com/en/4.2/topics/testing/tools/#django.test.SimpleTestCase.assertContains

Set html to True to handle text as HTML. The comparison with the response content will be based on HTML semantics instead of character-by-character equality. Whitespace is ignored in most cases, attribute ordering is not significant. See assertHTMLEqual() for more details.

@microamp
Copy link
Collaborator Author

https://github.com/ietf-tools/datatracker/actions/runs/10802493115/job/29964666951?pr=7921#step:6:1897

The test failing above appears to be unrelated to this PR.

Also, I could not reproduce it locally.

ietf/manage.py test --settings=settings_test
...
Ran 1547 tests in 1420.206s

OK

Copy link

codecov bot commented Sep 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.83%. Comparing base (c7f6bde) to head (e870ef1).
Report is 63 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7921      +/-   ##
==========================================
+ Coverage   88.78%   88.83%   +0.04%     
==========================================
  Files         296      304       +8     
  Lines       41320    41495     +175     
==========================================
+ Hits        36687    36861     +174     
- Misses       4633     4634       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@microamp
Copy link
Collaborator Author

The job was re-run but failed again. https://github.com/ietf-tools/datatracker/actions/runs/10802493115/job/29971686883?pr=7921#step:6:1896

On the third attempt, all tests successfully passed. https://github.com/ietf-tools/datatracker/actions/runs/10802493127/job/29964665583?pr=7921

I'll create an issue re: reproducible tests unless there's one already.

@microamp microamp marked this pull request as ready for review September 11, 2024 08:36
@rjsparks rjsparks merged commit 8d608a1 into ietf-tools:main Sep 12, 2024
9 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants