From 27b2ca99e0b06765d0ae8b5df74ff0e0b1d17ec0 Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Mon, 25 Jan 2021 15:07:15 +0900 Subject: [PATCH 1/4] fix: fix windows ci --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f5fc1aa81ed4ef..e8957a2b638fd1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -232,7 +232,7 @@ jobs: - name: Configure hosts file for WPT (windows) if: runner.os == 'Windows' working-directory: test_util/wpt/ - run: python wpt make-hosts-file | Out-File $env:SystemRoot\System32\drivers\etc\hosts -Encoding ascii -Append + run: python wpt --py2 make-hosts-file | Out-File $env:SystemRoot\System32\drivers\etc\hosts -Encoding ascii -Append - name: Test release if: matrix.kind == 'test_release' From 05f3908429ce2a9f007887f98b9ec9b6f4e3d738 Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Mon, 25 Jan 2021 15:56:03 +0900 Subject: [PATCH 2/4] fix(test): use py2 for wpt serve --- cli/tests/integration_tests.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index bd197daff86ef8..e848db3c6648aa 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -5311,6 +5311,7 @@ fn web_platform_tests() { let mut proc = Command::new(python) .current_dir(util::wpt_path()) .arg("wpt.py") + .arg("--py2") .arg("serve") .stderr(std::process::Stdio::piped()) .spawn() From 477c8efefa3726f228b6fd0828a8b22cb5ff14b4 Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Mon, 25 Jan 2021 17:09:18 +0900 Subject: [PATCH 3/4] run ci again From b25db11668daf19d2e9b9889ce3206dea1ec340d Mon Sep 17 00:00:00 2001 From: Luca Date: Mon, 25 Jan 2021 10:58:38 +0100 Subject: [PATCH 4/4] python3? --- .github/workflows/ci.yml | 4 ++-- cli/tests/integration_tests.rs | 41 +++------------------------------- 2 files changed, 5 insertions(+), 40 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8957a2b638fd1..074b9ca0d59aa2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -90,7 +90,7 @@ jobs: - name: Install Python uses: actions/setup-python@v1 with: - python-version: "2.7" + python-version: "3.8" architecture: x64 - name: Install Node @@ -232,7 +232,7 @@ jobs: - name: Configure hosts file for WPT (windows) if: runner.os == 'Windows' working-directory: test_util/wpt/ - run: python wpt --py2 make-hosts-file | Out-File $env:SystemRoot\System32\drivers\etc\hosts -Encoding ascii -Append + run: python.exe wpt --py3 make-hosts-file | Out-File $env:SystemRoot\System32\drivers\etc\hosts -Encoding ascii -Append - name: Test release if: matrix.kind == 'test_release' diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index e848db3c6648aa..8de51474ca60ad 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -5297,59 +5297,24 @@ fn web_platform_tests() { let config: std::collections::HashMap> = deno_core::serde_json::from_value(jsonc_to_serde(jsonc)).unwrap(); - // Observation: `python3 wpt serve` hangs with the python3 from homebrew - // but works okay with /usr/bin/python, which is python 2.7.10. Observed - // with homebrew python 3.8.5, 3.8.7 and 3.9.1. let python = match true { _ if cfg!(target_os = "windows") => "python.exe", - _ if cfg!(target_os = "macos") => "python", _ => "python3", }; eprintln!("If the wpt server fails or gets stuck, please set up your /etc/hosts file like specified in //docs/contributing/building_from_source.md."); + eprintln!("On windows python.exe needs to available in your path, and needs to point to python 3. On macOS and Linux, python3 needs to be available in your path."); let mut proc = Command::new(python) .current_dir(util::wpt_path()) .arg("wpt.py") - .arg("--py2") .arg("serve") .stderr(std::process::Stdio::piped()) .spawn() .unwrap(); - let stderr = proc.stderr.as_mut().unwrap(); - let mut stderr = BufReader::new(stderr).lines(); - let mut ready_8000 = false; - let mut ready_8443 = false; - let mut ready_8444 = false; - let mut ready_9000 = false; - while let Ok(line) = stderr.next().unwrap() { - if !line.starts_with("DEBUG:") { - eprintln!("{}", line); - } - if cfg!(target_os = "windows") && line.contains("Using ports") { - break; - } - if line.contains("web-platform.test:8000") { - ready_8000 = true; - } - if line.contains("web-platform.test:8443") { - ready_8443 = true; - } - if line.contains("web-platform.test:8444") { - ready_8444 = true; - } - if line.contains("web-platform.test:9000") { - ready_9000 = true; - } - // WPT + python2 doesn't support HTTP/2.0. - if line.contains("Cannot start HTTP/2.0 server") { - ready_9000 = true; - } - if ready_8000 && ready_8443 && ready_8444 && ready_9000 { - break; - } - } + // Give the wpt runner time to start up. + std::thread::sleep(std::time::Duration::from_secs(5)); let _wpt_server = WPTServer(proc);