-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Submission/unipro #135
Submission/unipro #135
Conversation
There are a lot of things that need attention.
These are all I have found at this moment. Please fix these issues, and I'll take a look again. |
(fwiw "seperate html files per js test" certainly isn't something that is required in general, although I guess if you plan to enforce it for this directory that's your own decision. I would advise against it however; it makes test writing significantly harder and generally discourages people from writing as many tests) |
Main part of the requested changes is done. A copule of questions and comments:
All other requested changes are done. Please review |
@sgrekhov I'm going to answer each bullet in the order you wrote:
I find the commit history is messy and it's hard to review this (having 10 commits just saying "review and formatting" does not sound right); could you consider reordering and cleaning up the history (i.e. dividing the changes into small commits, each of which makes sense as a single independent change)? Also, I'd like the commit messages to be more detailed and descriptive. |
I updated Help metadata and changed Ref tests format to HTML5 RE: "Did you have a discussion about the coverage tool?". It wasn't discussed anywhere. Only in emails and people found it convenient and useful. So I'm going to submit it soon and if you found it useless then remove it from the tests (together with "highlight" metadata). RE: "commit history". Thank you for pointing. We'll change commit messages to be more descriptive |
Yuta-san, please review |
Sorry, didn't have time to look at this. I will make some time tomorrow. |
Sorry for being late. Still I need to talk about the format:
Please refer the relevant documents about the test format, and also look at other test suites in web-platform-tests. Some test suites don't follow the format strictly, but that wouldn't be a reason for you to not follow the rule. There are some documentation you must read:
Note that the second is HTML WG's document and the third is CSS WG's. They are documents from other WGs, but still useful. Also, keep in mind that other people will read, update or maintain your tests. Authoring tests is not the end of the story. It's actually the beginning. |
Yuta-san, thank you for review. Before doing the requested changes I'd like you to take a look to the spec_coverage tool that I just submitted (please run https://github.com/sgrekhov/web-platform-tests/blob/submission/unipro/html-templates/spec/spec_coverage.html). It shows how specification is covered by the tests. This tool had a very good reviews in Shadow DOM project. Requested changes will make the tool non-working because it uses our PROPS, section numbers in test names, tests for the tool should be stored in .js files not in the .html ones etc. |
There should be no need to have your own meta data function for doing test coverage tools. Please just use the APIs we already have. There are already ways to extract the meta data, and you should rather change testharness.js if it doesn't do something than to introduce another special way to do it. Also, everything in the above comment makes much sense. Indeed looking at how other test suites are done will give hints to how they look their best. :) |
The above review comment I meant, the points put forward to be fixed there. I'm on a phone :) Also, we've got a testrunner which reads manifest.txt files and can run tests in sequence, and show a summary. Things like that should not be done for one and one testsuite, but at a higher level. |
I'm neutral regarding the adoption of the coverage tool, but I don't think the tool should be committed to web-platform-tests repository. It should probably be in a new separate repository. I guess starting a discussion at the public-webapps-testsuite mailing list might be a good way to move forward on the tool... |
I removed the coverage tool and changed test structure according to the Yuta's notes. Please review. |
Yuta-san, please review the existing test suite (I'm keeping in ming restructurisation of the commit history, sorry for dalay) |
Let me know once the issues in my prior comments are (mostly) resolved. If I made further comments without making sure outstanding issues are resolved, it would be hard to keep track of what issues were raised, what were not, what were fixed, or what weren't fixed. |
Please see my notes inline
Not fixed yet.
Fixed
Fixed
Fixed
Fixed
Fixed
Fixed
Fixed
Fixed but I didn't carefully check all of the source files. There can be some lost files with nonconsistent indention. I'll check the files later. This task is in my list
We use functionName naming convention as described at http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml. But testharness uses assert_foobar convention.
I didn't find any. Could you please point to an example of debugging code? |
For debugging code: I see some instances in testcommon.js. Also, my comments on "reviewer" field does not seem to be addressed. Some more generic comments:
Generally the tests are getting better; I think I can comment on each test in the next round of review. |
Yuta-san, thank you for review. Let's take a look to the tests in html-templates/definitions folder. I fixed all of the issues for them, so please review them. If they are ok, I'll change the other tests in the same way. In more details changes are the following:
Only two items are still uncovered. The first one is the commit history. It'll be my next step. The second item is the third (optional) argument of assert_*(). We always use the third argument and I believe there are at least two good reasons for that:
So we'd like to preserve this policy "Always add descriptive third argument to all assertions and make it unique if possible". |
Okay, I'll comment in each test when the commit history becomes clean (it's pretty hard to leave inline comments for now). |
Yuta-san, we removed all of the history and performed the new commit. Only tests for "Definition" chapter of the spec. Please review |
Overall, your tests are getting significantly better. Please take a look at my inline comments. |
Almost all of the above have been fixed. See my inline notes concerning the items which were not fixed. Please review |
OK, I think it's fine. What's your take, @dglazkov ? |
- Creating an element for the token - Appending to a template
Yuta-san, Dmitriy, please review the new bunch of tests. We are close to the milestone so I'm going to submit all of the test that should be in completed by the time of the milestone this week. I'm going to submit by 1-2 chapters every day |
@rafaelw, will you take a look? I'll review these tomorrow morning. |
… to "foster parenting"' chapters of the specification
So it looks like the tests in web-platform-tests / html-templates / additions-to-the-css-user-agent-style-sheet / require manual verification ('this test passes if there's nothing below this line')., which doesn't seem good. There must be a way to programmatically tell whether the template element is taking up any layout space? Like maybe putting elements after it and measuring their position. |
Rafael, in the Shadow DOM test suite we checked visibility programmatically. By checking element.offsetTop to determine if element visible or not (invisible element always have offsetTop 0). But one of the Google engineers response to ShadowDOM tests was the following: • No ref tests where they ought to be some (e.g. using things like ".offsetTop > 0" to test whether the element is rendered, but this is rather weak). That's why here we use ref tests that requires manual verification. |
Reftests can be automated through WebDriver. I'm actually more concerned about it being difficult to identify reftests as such. The CSS WG uses the |
Reftests renamed to .xht |
Hi All. And if there's no more comments from your end may be it makes sense to pull these tests to master branch? |
I think either way is fine. I feel like functions like |
…7.16 Additions to the "in frameset" insertion mode"
assert_true(... != null) replaced by assert_not_null(...) |
+1. Care to write a patch? |
} | ||
|
||
function assert_null(value, description) { | ||
assert_true(value == null, description); |
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.
This should use ===
if it exists at all. I don't know why this is better than using assert_equals(x, null)
, though.
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.
In this case (===) tests that checks 'undefined' will fail (we use this function to check both null and undefined). assert_null_or_undefined() would be better name for this function but it's rather long
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.
Being precise and explicit here is important. Either rename to assert_null_or_undefined
or use ===
.
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.
And in all the cases I looked at, the test should fail if undefined
is returned.
I'm fine with this, would like @yutak's opinion, though, as he's been reviewing those precisely. I haven't. |
I don't see the value of the |
The value of these functions is that: assert_not_null(something, "Unexpected null") is more readable than assert_true(something !== null, "Unexpected null") Also assert_null is safer because it's easy to make a mistake and write assert_true(something == null,..) instead of === So I believe it makes sense to use the functions. But if you insist I can remove them |
The comparison you make doesn't make sense to me. These assertions would be written simply as
which doesn't seem so bad to me that you'd need to wrap it into a helper. |
I removed the functions and replaced them by assert_equals(something, null); |
Great! @yutak can we get your final approval on this pull request? |
I'm fine with the change ;) |
assoc is now deprecated in favor of evolve.
dd57b9f0db chore(package): update dev deps 7f99dea07c chore(package): bump version number to 10.2.1 c357d4cb01 Add bug link and remove unnecessary quote tests cd1f7a95ba Add a comment about not using for (const ...) 39a957721c Tokenise a solitary '/' correctly 4efd252f5e Use "let" instead of "var" in for statement f940514f36 Add count() function. Use idiomatic string methods. affdfbdc2b Optimise tokenisation and whitespace skipping ba00d5d9ec refactor: small syntax changes (web-platform-tests#137) d5c4fbfdfc chore(CHANGELOG): regenerate 3d009b634a chore(CHANGELOG): regenerate 23bb9bb290 chore(CHANGELOG): regenerate 6db306af62 chore(package): bump version number to 10.2.0 ac7ef088f3 fix: solve conflicts from typing union types f422f2a6f5 feat: type on union types (web-platform-tests#135) bde0553b49 feat: add const-type for idlTypes (web-platform-tests#132) c03cd7e8f3 feat: add dictionary/typedef-type (web-platform-tests#133) 6eb1e7f4db feat: add argument/return type (web-platform-tests#134) d2cfdfd901 feat: add type: attribute-type on idlTypes (web-platform-tests#131) 1e29dcb71b Auto acquisition for parser result changes (web-platform-tests#130) 154eabfbb1 chore(package): update mocha, expect, bump version 36932debd7 Let error messages include the current definition name (web-platform-tests#129) 664f63b61e chore(package-lock): regenerate 536157bffa chore(package): bump version number to 10.0.0 d5b88179df chore(pacakge): upgrade expect dep 0c103b356e Maintain writer.js (web-platform-tests#122) e2d4467ea1 remove typeExtAttrs from docs 0226b76587 remove iterator documentation (web-platform-tests#123) e36ae6bf70 BREAKING CHANGE: remove deprecated iterator operation (web-platform-tests#121) 8e73c4ff4c use for-of on tests c56a921d9b docs(README): iterables ildType is always array 3f39cb152e chore(CHANGELOG): regenerate ae0060f859 chore(package): bump version number to 9.0.0 24669ed245 BREAKING CHANGE: consistent array type for iterable.idlType (web-platform-tests#117) f89b5803c7 Update package-lock.json f581ac63c3 Add myself to contributors in package.json 420ac52ac5 Revert "chore: drop Node 6 support (web-platform-tests#102)" 1c031ed86e chore(CHANGELOG): regenerate git-subtree-dir: resources/webidl2 git-subtree-split: dd57b9f0db1adbb5712f9fdd6a4e38533ff4ba4b
The first bunch of HTML template tests