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

tests: improve output information #759

Merged
merged 4 commits into from
Nov 19, 2024
Merged

Conversation

n0toose
Copy link
Member

@n0toose n0toose commented Sep 20, 2024

  • Print to stdout as soon as the kernel successfully boots
  • Print to stdout in run_simple_vm to make it clear that the kernel has been compiled
  • Clarify the test-kernel being built, as the "name mismatch" between fs-test.rs and create_file.rs can be a bit confusing
  • Add newline between build_hermit_bin + run_simple_vm output and output coming from the kernel
  • Minor linguistic improvements

These changes may seem redundant to the trained eye (for example, it is safe to assume that the output starting with "frequency: ..." is from the kernel, thus everything that follows is from the kernel), but can be very helpful to beginners.

Based on local changes that I created for personal use, so as to better understand the debugging process.

@n0toose
Copy link
Member Author

n0toose commented Sep 20, 2024

Before:

test new_file_test ... FAILED

failures:

---- new_file_test stdout ----
Building Kernel create_file
frequencies: 2604
CPU frequencies are not all equal
thread 'new_file_test' panicked at tests/common.rs:52:5:
assertion `left == right` failed
  left: 0
 right: 1
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    new_file_test

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 3.02s

After:

test new_file_test ... FAILED

failures:

---- new_file_test stdout ----
Building test kernel: create_file
Launching kernel in path: tests/test-kernels/target/x86_64-unknown-hermit/debug/create_file

frequencies: 2874
CPU frequencies are not all equal
thread 'new_file_test' panicked at tests/common.rs:55:5:
assertion `left == right` failed
  left: 0
 right: 1
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    new_file_test

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.97s

error: test failed, to rerun pass `--test fs-test`

@jounathaen
Copy link
Member

Can you cherry-pick 57f01a7 into this PR?

@jounathaen jounathaen changed the title test: improve output information tests: improve output information Sep 23, 2024
@n0toose
Copy link
Member Author

n0toose commented Sep 23, 2024

Can you cherry-pick 57f01a7 into this PR?

Recreated the commit with your author information, hope nothing broke in the process of doing so.

tests/common.rs Outdated Show resolved Hide resolved
- Print to stdout as soon as the kernel successfully boots
- Print to stdout in run_simple_vm to make it clear that the kernel has
  been compiled
- Clarify the test-kernel being built, as the "name mismatch" between
  fs-test.rs and create_file.rs can be a bit confusing
- Add newline between build_hermit_bin + run_simple_vm output and
  output coming from the kernel
- Minor linguistic improvements

These changes may seem redundant to the trained eye (for example,
it is safe to assume that the output starting with "frequency: ..."
is from the kernel, thus everything that follows is from the kernel),
but can be very helpful to beginners.

Based on local changes that I created for personal use, so as to better
understand the debugging process.
Copy link

codecov bot commented Sep 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.92%. Comparing base (c0a8bac) to head (3813588).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #759      +/-   ##
==========================================
+ Coverage   67.79%   67.92%   +0.13%     
==========================================
  Files          19       19              
  Lines        2453     2463      +10     
==========================================
+ Hits         1663     1673      +10     
  Misses        790      790              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@n0toose
Copy link
Member Author

n0toose commented Sep 23, 2024

tests: improve output information

P.S. wrote test instead of tests in the commit because of the conventional commits standard

@n0toose
Copy link
Member Author

n0toose commented Nov 19, 2024

@jounathaen seems like this should not conflict with my WIP changes in #783, should be a rebase at most. Is that good to go?

@jounathaen
Copy link
Member

It is! Thanks for your contribution ❤️

@jounathaen jounathaen enabled auto-merge November 19, 2024 19:00
@jounathaen jounathaen added this pull request to the merge queue Nov 19, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 19, 2024
@jounathaen jounathaen added this pull request to the merge queue Nov 19, 2024
Merged via the queue into hermit-os:main with commit 7843de8 Nov 19, 2024
10 checks passed
@jounathaen jounathaen deleted the test-output branch November 19, 2024 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants