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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

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.38%. Comparing base (aa3379f) to head (355a3f4).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #759      +/-   ##
==========================================
- Coverage   67.65%   67.38%   -0.27%     
==========================================
  Files          18       18              
  Lines        2331     2355      +24     
==========================================
+ Hits         1577     1587      +10     
- Misses        754      768      +14     

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

@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

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