Skip to content

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

Merged
rjsparks merged 1 commit intoietf-tools:mainfrom
microamp:test/ipr-search-results
Sep 12, 2024
Merged

test: check IPR search results in HTML with whitespace ignored#7921
rjsparks merged 1 commit intoietf-tools:mainfrom
microamp:test/ipr-search-results

Conversation

@microamp
Copy link
Copy Markdown
Contributor

@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
Copy Markdown
Contributor 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

@codecov
Copy link
Copy Markdown

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
Copy Markdown
Contributor 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
@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