Navigation Menu

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

[py3] convert conformance-checkers/tools/*.py #28812

Merged
merged 1 commit into from May 5, 2021

Conversation

foolip
Copy link
Member

@foolip foolip commented May 4, 2021

Because dicts are ordered in Python 3, the order of the tests generated
by url.py change. It was confirmed that exactly the same set of lines
have been added and removed, with this command:

diff <(git diff | grep '^+[^+]' | cut -c 2- | sort) <(git diff | grep '^-[^-]' | cut -c 2- | sort)

Also ensure update-built-tests.sh is run when conformance-checkers/ is
updated, missed in #28832.

@foolip
Copy link
Member Author

foolip commented May 4, 2021

@sideshowbarker this doesn't work yet, but before I spend any more time on it I'd like to ask if these scripts are actually used? Even the py2 variants produce lots of changes, so maybe they were once used to create lots of tests, but those tests have then been edited by hand? Should they be brought into sync again?

@sideshowbarker
Copy link
Contributor

@sideshowbarker this doesn't work yet, but before I spend any more time on it I'd like to ask if these scripts are actually used?

The build-svg-tests.py one is the only that’s not used. I think. I suppose we could just remove it.

The others are still used, though not often. @zcorpan developed some of them (maybe most).

Even the py2 variants produce lots of changes, so maybe they were once used to create lots of tests, but those tests have then been edited by hand?

If any of the test files those script generate — other than the SVG tests — were edited by hand, then that’s an oversight and a bug. In all cases, what should happen is that the code for generating them is edited instead.

Should they be brought into sync again?

They should be brought into sync again, yes.

foolip added a commit that referenced this pull request May 5, 2021
Running the scripts, one file is added, but everything else is in sync.

build-svg-tests.py isn't used according to @sideshowbarker:
#28812 (comment)

Preparing for #28812.
@foolip
Copy link
Member Author

foolip commented May 5, 2021

I've sent #28832 to first get this into a good state with Python 2.7.

@foolip foolip force-pushed the foolip/py3-conformance-checkers branch from 3bc0d46 to a03cb3a Compare May 5, 2021 10:26
sideshowbarker pushed a commit that referenced this pull request May 5, 2021
Running the scripts, one file is added, but everything else is in sync.

build-svg-tests.py isn't used according to @sideshowbarker:
#28812 (comment)

Preparing for #28812.
@foolip foolip force-pushed the foolip/py3-conformance-checkers branch from a03cb3a to a78d1b5 Compare May 5, 2021 11:18
@foolip foolip force-pushed the foolip/py3-conformance-checkers branch 2 times, most recently from 4d32e7a to feb4493 Compare May 5, 2021 11:39
Because dicts are ordered in Python 3, the order of the tests generated
by url.py change. It was confirmed that exactly the same set of lines
have been added and removed, with this command:
```sh
diff <(git diff | grep '^+[^+]' | cut -c 2- | sort) <(git diff | grep '^-[^-]' | cut -c 2- | sort)
```

Also ensure update-built-tests.sh is run when conformance-checkers/ is
updated, missed in #28832.
@foolip
Copy link
Member Author

foolip commented May 5, 2021

@zcorpan after your review I made some more fixes. The order of some files now changes a lot. Is that OK?

@zcorpan
Copy link
Member

zcorpan commented May 5, 2021

Yep!

@foolip foolip merged commit 2bc4fa6 into master May 5, 2021
@foolip foolip deleted the foolip/py3-conformance-checkers branch May 5, 2021 15:57
foolip added a commit that referenced this pull request May 6, 2021
#28812 made the script
unnecessarily complicated with a mix of strings and bytes, and made it
hard to tell if the written files might ever be invalid UTF-8.

It turns out that the output is unchanged if one simply operates on
strings all along. The change of ordering initially misled me.
sideshowbarker pushed a commit that referenced this pull request May 6, 2021
#28812 made the script
unnecessarily complicated with a mix of strings and bytes, and made it
hard to tell if the written files might ever be invalid UTF-8.

It turns out that the output is unchanged if one simply operates on
strings all along. The change of ordering initially misled me.
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request May 8, 2021
…date-built-tests.sh, a=testonly

Automatic update from web-platform-tests
Update conformance-checkers/ tests in update-built-tests.sh

Running the scripts, one file is added, but everything else is in sync.

build-svg-tests.py isn't used according to @sideshowbarker:
web-platform-tests/wpt#28812 (comment)

Preparing for web-platform-tests/wpt#28812.

--

wpt-commits: 59052ab2a73b9450a70d81ff7354456b6df99cc8
wpt-pr: 28832
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request May 9, 2021
…y back to using strings, a=testonly

Automatic update from web-platform-tests
Convert conformance-checkers/tools/url.py back to using strings

web-platform-tests/wpt#28812 made the script
unnecessarily complicated with a mix of strings and bytes, and made it
hard to tell if the written files might ever be invalid UTF-8.

It turns out that the output is unchanged if one simply operates on
strings all along. The change of ordering initially misled me.

--

wpt-commits: 5890c08d40d9c0cd9032282567d25fe149149ea7
wpt-pr: 28873
sideshowbarker pushed a commit to validator/tests that referenced this pull request Jun 16, 2021
Running the scripts, one file is added, but everything else is in sync.

build-svg-tests.py isn't used according to @sideshowbarker:
web-platform-tests/wpt#28812 (comment)

Preparing for web-platform-tests/wpt#28812.
sideshowbarker pushed a commit to validator/tests that referenced this pull request Jun 16, 2021
web-platform-tests/wpt#28812 made the script
unnecessarily complicated with a mix of strings and bytes, and made it
hard to tell if the written files might ever be invalid UTF-8.

It turns out that the output is unchanged if one simply operates on
strings all along. The change of ordering initially misled me.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants