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

[Merged by Bors] - Adding VM conformance output to PR checks #1685

Closed
wants to merge 9 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
34 changes: 31 additions & 3 deletions .github/workflows/test262.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
# Run the results comparison
- name: Compare results
if: github.event_name == 'pull_request'
id: compare
id: compare-non-vm
shell: bash
run: |
cd boa
Expand All @@ -61,6 +61,26 @@ jobs:
comment="${comment//$'\r'/'%0D'}"
echo "::set-output name=comment::$comment"

- name: Run the test262 test suite for VM
run: |
cd boa
mkdir -p ../results
cargo run --release --features vm --bin boa_tester -- run -v -o ../results/test262/vm
cd ..

# Run the results comparison for VM
- name: Compare results for VM
if: github.event_name == 'pull_request'
id: compare-vm
shell: bash
run: |
cd boa
comment="$(./target/release/boa_tester compare ../gh-pages/test262/refs/heads/main/vm-latest.json ../results/test262/vm/pull/latest.json -m)"
comment="${comment//'%'/'%25'}"
comment="${comment//$'\n'/'%0A'}"
comment="${comment//$'\r'/'%0D'}"
echo "::set-output name=comment::$comment"

- name: Get the PR number
if: github.event_name == 'pull_request'
id: pr-number
Expand All @@ -80,7 +100,11 @@ jobs:
continue-on-error: true
with:
comment-id: ${{ steps.previous-comment.outputs.comment-id }}
body: ${{ steps.compare.outputs.comment }}
body: |
### Test262 conformance changes

${{ steps.compare-non-vm.outputs.comment }}
${{ steps.compare-vm.outputs.comment }}
edit-mode: replace

- name: Write a new comment
Expand All @@ -89,7 +113,11 @@ jobs:
continue-on-error: true
with:
issue-number: ${{ steps.pr-number.outputs.pr }}
body: ${{ steps.compare.outputs.comment }}
body: |
### Test262 conformance changes

${{ steps.compare-non-vm.outputs.comment }}
${{ steps.compare-vm.outputs.comment }}

# Commit changes to GitHub pages.
- name: Commit files
Expand Down
3 changes: 3 additions & 0 deletions boa_tester/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ exclude = ["../.vscode/*", "../Dockerfile", "../Makefile", "../.editorConfig"]
edition = "2021"
rust-version = "1.56"

[features]
vm = ["Boa/vm"]

[dependencies]
Boa = { path = "../boa" }
structopt = "0.3.25"
Expand Down
12 changes: 7 additions & 5 deletions boa_tester/src/results.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ pub(crate) fn compare_results(base: &Path, new: &Path, markdown: bool) {
let new_conformance = (new_passed as f64 / new_total as f64) * 100_f64;
let conformance_diff = new_conformance - base_conformance;

let test_diff = compute_result_diff(base, &base_results.results, &new_results.results);
let test_diff = compute_result_diff(Path::new(""), &base_results.results, &new_results.results);

if markdown {
use num_format::{Locale, ToFormattedString};
Expand All @@ -218,7 +218,11 @@ pub(crate) fn compare_results(base: &Path, new: &Path, markdown: bool) {
)
}

println!("### Test262 conformance changes:");
#[cfg(feature = "vm")]
println!("#### VM implementation");
#[cfg(not(feature = "vm"))]
println!("#### Non-VM implementation");

println!("| Test result | main count | PR count | difference |");
println!("| :---------: | :----------: | :------: | :--------: |");
println!(
Expand Down Expand Up @@ -426,9 +430,7 @@ fn compute_result_diff(
{
let test_name = format!(
"test/{}/{}.js {}(previously {:?})",
base.strip_prefix("../gh-pages/test262/refs/heads/main/latest.json")
.expect("error removing prefix")
.display(),
base.display(),
new_test.name,
if base_test.strict {
"[strict mode] "
Expand Down