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 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
Member

@sideshowbarker sideshowbarker commented May 5, 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?

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 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 May 5, 2021
sideshowbarker 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 foolip force-pushed the foolip/py3-conformance-checkers branch from a03cb3a to a78d1b5 May 5, 2021
@zcorpan
zcorpan approved these changes May 5, 2021
@foolip foolip force-pushed the foolip/py3-conformance-checkers branch 2 times, most recently from 4d32e7a to feb4493 May 5, 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:
```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 foolip force-pushed the foolip/py3-conformance-checkers branch from feb4493 to 44a2e28 May 5, 2021
@foolip foolip marked this pull request as ready for review May 5, 2021
@foolip
Copy link
Member Author

@foolip 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
zcorpan approved these changes May 5, 2021
@zcorpan
Copy link
Member

@zcorpan zcorpan commented May 5, 2021

Yep!

@foolip foolip merged commit 2bc4fa6 into master May 5, 2021
34 checks passed
34 checks passed
@github-actions
build-and-publish
Details
@github-actions
build-and-tag
Details
@azure-pipelines
Azure Pipelines Build #20210505.38 succeeded
Details
@azure-pipelines
Azure Pipelines (./wpt test-jobs) ./wpt test-jobs succeeded
Details
@azure-pipelines
Azure Pipelines (affected tests without changes: Safari Technology Preview) affected tests without changes: Safari Technology Preview succeeded
Details
@azure-pipelines
Azure Pipelines (affected tests: Safari Technology Preview) affected tests: Safari Technology Preview succeeded
Details
@azure-pipelines
Azure Pipelines (infrastructure/ tests: macOS) infrastructure/ tests: macOS succeeded
Details
@azure-pipelines
Azure Pipelines (tools/ unittests: Windows + Python 3.6) tools/ unittests: Windows + Python 3.6 succeeded
Details
@azure-pipelines
Azure Pipelines (tools/ unittests: Windows + Python 3.9) tools/ unittests: Windows + Python 3.9 succeeded
Details
@azure-pipelines
Azure Pipelines (tools/ unittests: macOS + Python 3.6) tools/ unittests: macOS + Python 3.6 succeeded
Details
@azure-pipelines
Azure Pipelines (tools/ unittests: macOS + Python 3.9) tools/ unittests: macOS + Python 3.9 succeeded
Details
@azure-pipelines
Azure Pipelines (tools/wpt/ tests: Windows + Python 3.6) tools/wpt/ tests: Windows + Python 3.6 succeeded
Details
@azure-pipelines
Azure Pipelines (tools/wpt/ tests: Windows + Python 3.9) tools/wpt/ tests: Windows + Python 3.9 succeeded
Details
@azure-pipelines
Azure Pipelines (tools/wpt/ tests: macOS + Python 3.6) tools/wpt/ tests: macOS + Python 3.6 succeeded
Details
@azure-pipelines
Azure Pipelines (tools/wpt/ tests: macOS + Python 3.9) tools/wpt/ tests: macOS + Python 3.9 succeeded
Details
@azure-pipelines
Azure Pipelines (tools/wptrunner/ unittests: Windows + Python 3.6) tools/wptrunner/ unittests: Windows + Python 3.6 succeeded
Details
@azure-pipelines
Azure Pipelines (tools/wptrunner/ unittests: Windows + Python 3.9) tools/wptrunner/ unittests: Windows + Python 3.9 succeeded
Details
@azure-pipelines
Azure Pipelines (tools/wptrunner/ unittests: macOS + Python 3.6) tools/wptrunner/ unittests: macOS + Python 3.6 succeeded
Details
@azure-pipelines
Azure Pipelines (tools/wptrunner/ unittests: macOS + Python 3.9) tools/wptrunner/ unittests: macOS + Python 3.9 succeeded
Details
@azure-pipelines
Azure Pipelines (wpt.fyi hook: safari-preview-affected-tests) wpt.fyi hook: safari-preview-affected-tests succeeded
Details
@azure-pipelines
Azure Pipelines (wpt.fyi hook: safari-preview-affected-tests-without-changes) wpt.fyi hook: safari-preview-affected-tests-without-changes succeeded
Details
@community-tc-integration
download-firefox-nightly Community-TC (pull_request)
Details
@community-tc-integration
infrastructure/ tests Community-TC (pull_request)
Details
@community-tc-integration
lint Community-TC (pull_request)
Details
@community-tc-integration
resources/ tests (Python 3.6) Community-TC (pull_request)
Details
@community-tc-integration
resources/ tests (Python 3.9) Community-TC (pull_request)
Details
@community-tc-integration
sink-task Community-TC (pull_request)
Details
@community-tc-integration
tools/ integration tests (Python 3.6) Community-TC (pull_request)
Details
@community-tc-integration
tools/ integration tests (Python 3.9) Community-TC (pull_request)
Details
@community-tc-integration
tools/ unittests (Python 3.6) Community-TC (pull_request)
Details
@community-tc-integration
tools/ unittests (Python 3.9) Community-TC (pull_request)
Details
@community-tc-integration
update-built Community-TC (pull_request)
Details
@community-tc-integration
wpt-decision-task Community-TC (pull_request)
Details
@wpt-fyi
wpt.fyi - safari[experimental] Safari results
Details
@foolip foolip deleted the foolip/py3-conformance-checkers branch May 5, 2021
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 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.
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 added 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 added 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
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants