-
Notifications
You must be signed in to change notification settings - Fork 685
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
app-tests
: validates HTML source saved from page-layout tests
#6072
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code and rest of the change looks good to me. Tested locally, can get many errors like below:
"file:/root/code/securedrop/securedrop/tests/pageslayout/html/ar/journalist-admin_ossec_alert_button.html":1.1-1.26: error: Start tag seen without seeing a doctype first. Expected "<!DOCTYPE html>".
"file:/root/code/securedrop/securedrop/tests/pageslayout/html/ar/journalist-admin_ossec_alert_button.html":36.5-36.37: error: Element "div" not allowed as child of element "label" in this context. (Suppressing further errors from this subtree.)
"file:/root/code/securedrop/securedrop/tests/pageslayout/html/ar/journalist-admin_ossec_alert_button.html":39.5-39.37: error: Element "div" not allowed as child of element "label" in this context. (Suppressing further errors from this subtree.)
"file:/root/code/securedrop/securedrop/tests/pageslayout/html/ar/journalist-admin_ossec_alert_button.html":42.5-42.40: error: Element "div" not allowed as child of element "label" in this context. (Suppressing further errors from this subtree.)
"file:/root/code/securedrop/securedrop/tests/pageslayout/html/ar/journalist-login.html":1.1-1.26: error: Start tag seen without seeing a doctype first. Expected "<!DOCTYPE html>".
"file:/root/code/securedrop/securedrop/tests/pageslayout/html/ar/journalist-login.html":30.5-30.37: error: Element "div" not allowed as child of element "label" in this context. (Suppressing further errors from this subtree.)
"file:/root/code/securedrop/securedrop/tests/pageslayout/html/ar/journalist-login.html":33.5-33.37: error: Element "div" not allowed as child of element "label" in this context. (Suppressing further errors from this subtree.)
"file:/root/code/securedrop/securedrop/tests/pageslayout/html/ar/journalist-login.html":36.5-36.40: error: Element "div" not allowed as child of element "label" in this context. (Suppressing further errors from this subtree.)
make: *** [Makefile:231: validate-test-html] Error 255
But, in CI I can not see the actual errors. I guess we want that too (as mentioned in the test plan).
@SaptakS please let me know what do you think.
@@ -13,6 +13,8 @@ RUN apt-get update && apt-get install -y paxctl && \ | |||
python3-pip python3-all python3-venv virtualenv libpython3.8-dev libssl-dev \ | |||
gnupg2 ruby redis-server git xvfb curl wget \ | |||
gettext paxctl x11vnc enchant libffi-dev sqlite3 gettext sudo \ | |||
# for html5validator | |||
default-jdk \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally we are an enterprise application :)
This threw me too! As CircleCI is currently splitting the tests across the three parallel runs, run 0 (at least on this execution) doesn't include any page-layout tests, so it doesn't save any HTML to validate. But runs 1 and 2 do. I tried to anticipate this by having the |
…ted (per review feedback) thread: #6072 (review)
…ted (per review feedback) Otherwise, "app-tests" runs to which CircleCI has not assigned any page-layout tests will appear to include a validation step that returns no results. thread: #6072 (review)
8a2a874
to
2ed9fce
Compare
In 2ed9fce I've added an explicit count of how many |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing steps
- After running page-layout tests locally,
make validate-test-html
reports meaningful results (i.e., lots of errors :-). -
app-tests
passes (e.g.) despite lots of "informational" errors reported in the "Validate HTML" step.
Tested locally, works as expected. html
directory is also marked in .gitignore
.
Status
Ready for review
Description of Changes
Closes #1897 by:
html5validator
in thetest-requirements
used in CI pipelines;FunctionalTest._save_html()
in the spirit ofFunctionalTest._screenshot()
;validate-test-html
to validate the HTML source saved from such tests; andapp-tests
.Discussion points
nightly
workflow.app-tests
, further prolonging its runtime? One alternative would be to factor out page-layout tests to a separate job altogether, in parallel toapp-tests
, and include this validation step there.html5validator
requires a JDK, installed here asdefault-jdk
. Is this an acceptable addition to the development/test container?Testing
make validate-test-html
reports meaningful results (i.e., lots of errors :-).app-tests
passes (e.g.) despite lots of "informational" errors reported in the "Validate HTML" step.Deployment
Development-only; no deployment considerations.
Checklist
If you added or updated a code dependency:
I have performed a diff review and pasted the contents to the packaging wikiI would like someone else to do the diff reviewtest-requirements
only.