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

fix(ci): fix windows ci #9261

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.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'
Expand Down
40 changes: 3 additions & 37 deletions cli/tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5297,16 +5297,13 @@ fn web_platform_tests() {
let config: std::collections::HashMap<String, Vec<WptConfig>> =
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.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should check this here in Rust? Like start python.exe --version and see that it has the correct output?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be ok if I do this when I move the WPT runner to TS?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not convinced about moving WPT runner to TS, but sure


let mut proc = Command::new(python)
.current_dir(util::wpt_path())
Expand All @@ -5316,39 +5313,8 @@ fn web_platform_tests() {
.spawn()
.unwrap();

let stderr = proc.stderr.as_mut().unwrap();
let mut stderr = BufReader::new(stderr).lines();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should remove use declaration of this as well?

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));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:)


let _wpt_server = WPTServer(proc);

Expand Down