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

Colored output for tests #4

Open
vityaman opened this issue Sep 2, 2024 · 3 comments
Open

Colored output for tests #4

vityaman opened this issue Sep 2, 2024 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@vityaman
Copy link

vityaman commented Sep 2, 2024

Currently there are just logs in default terminal color. Want it to look fancy. ANSI escape codes can be used.

@vityaman vityaman added enhancement New feature or request good first issue Good for newcomers labels Sep 2, 2024
@manas-02
Copy link

manas-02 commented Sep 2, 2024

Hi, I am new to open-source contributions. I would like to help. Can u share some details of the project.

@vityaman
Copy link
Author

vityaman commented Sep 2, 2024

@manas-02, hi! It is very unexpected and nice to receive such an offer from you.

We develop an OS course in the ITMO University. We have some homeworks related to kernel development, there student should add some features to the educational OS Xv6 developed in the MIT: write some syscalls, add linked lists to the kernel structures and implement COW fork with lazy allocation.

We leave the Xv6 as it is, but want to improve the experience for students. One of improvements is automated testing of the OS. Currently tests exist as a binary that is run inside the OS under QEMU and it just prints messages like "test bigdir: OK" to stdout.

We want to run tests in a GitHub Workflow to check that tests was passed. This will let us (teachers and assistants) to concentrate on the logic and style of changes student sent via an MR, rather than ensuring that code is working correctly.

For this we are currently developing a python script for parsing OS output: #3 (review stage). It prints output in a such format (available in Actions):

Starting Xv6 userspace tests...
Qemu was started.
Kernel was booted.
[ 0%] Running test 'copyin'...       20.000s >  6.527s => OK!
[ 4%] Running test 'copyout'...       0.200s >  0.016s => OK!
[ 4%] Running test 'copyinstr1'...    0.200s >  0.006s => OK!
[ 4%] Running test 'copyinstr2'...    0.200s >  0.009s => OK!
[ 4%] Running test 'copyinstr3'...    0.200s >  0.007s => OK!
[ 4%] Running test 'rwsbrk'...        1.000s >  0.042s => OK!
[ 4%] Running test 'truncate1'...     2.000s >  0.065s => OK!
[ 4%] Running test 'truncate2'...     2.000s >  0.053s => OK!
[ 5%] Running test 'truncate3'...    40.000s >  1.791s => OK!
[12%] Running test 'openiput'...      1.000s >  0.142s => OK!
[12%] Running test 'exitiput'...      1.000s >  0.046s => OK!
[12%] Running test 'iput'...          1.000s >  0.047s => OK!
...

This script can be used not only in GitHub, but on a students local machine. I thought that it would be nice to have fancy colored output and cool formatting. Just for fun.

@manas-02
Copy link

manas-02 commented Sep 2, 2024

Thanks, for providing details. This was my first request to an open source project. I am sorry but I am not familiar with python. I was expecting it to be a C or C++ project. Also I am not a professional programmer I am just a student, expecting to learn something new. So, sorry I don't think I will be of any help. Apologies for taking your time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants