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

Add test for log processing #1324

Merged
merged 1 commit into from
Nov 19, 2024
Merged

Conversation

elkoniu
Copy link
Contributor

@elkoniu elkoniu commented Oct 23, 2024

'/usr/libexec/anaconda/log-capture' is an util to generate runtime logs. This commit adds test validating output of this util.

Copy link
Contributor

@M4rtinK M4rtinK left a comment

Choose a reason for hiding this comment

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

Looks good to me - thanks! :)

Just added some suggestions for using fragments to provide generic/boilerplate bits in the kickstart via kickstart fragments. :)

efi-log.ks.in Outdated Show resolved Hide resolved
efi-log.ks.in Outdated Show resolved Hide resolved
@elkoniu
Copy link
Contributor Author

elkoniu commented Oct 30, 2024

@M4rtinK thanks for the review. I have updated the code following your guidelines. Also I have split test cases in half: check if the util exists, call the util and expect 0 return code. Do you thing this is good enough validation?

@elkoniu elkoniu marked this pull request as ready for review October 30, 2024 23:48
@KKoukiou
Copy link
Contributor

KKoukiou commented Nov 1, 2024

/test-tmt

@KKoukiou
Copy link
Contributor

KKoukiou commented Nov 1, 2024

/test-os-variants

@M4rtinK
Copy link
Contributor

M4rtinK commented Nov 1, 2024

@M4rtinK thanks for the review. I have updated the code following your guidelines. Also I have split test cases in half: check if the util exists, call the util and expect 0 return code. Do you thing this is good enough validation?

Agreed with the split - like this we can easily see from the logs what exactly went wrong, nice! :)

As for validation - it creates a tarball, right ? I guess we could check the file exists and is of non-zero size ? But I leave it up to you, given we already check the return code. :)

@elkoniu
Copy link
Contributor Author

elkoniu commented Nov 12, 2024

@M4rtinK @KKoukiou I think this PR is in final shape now and it is passing when I trigger it locally.

efi-log.sh Outdated Show resolved Hide resolved
efi-log-check.sh Outdated Show resolved Hide resolved
efi-log-check.sh Outdated Show resolved Hide resolved
Copy link
Contributor

@rvykydal rvykydal left a comment

Choose a reason for hiding this comment

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

Nice work.

We should perhaps clear up the TESTTYPE though (as suggested above)

Also I wouldn't create an include (lib) script at this point where the functions are used only in a single test. But if we create it I'd keep a (silent) convention of having -lib- in the name, ideally with post and nochroot hint. But this can be done updated / discussed in a followup PR. Having more tests using the shared script would also make easier to decide where to put the functions or how to name a new file if we create such.

@elkoniu
Copy link
Contributor Author

elkoniu commented Nov 13, 2024

Thanks for the review @rvykydal
I just pushed the latest version and tried to address all of your comments

Nice work.

We should perhaps clear up the TESTTYPE though (as suggested above)

Also I wouldn't create an include (lib) script at this point where the functions are used only in a single test. But if we create it I'd keep a (silent) convention of having -lib- in the name, ideally with post and nochroot hint. But this can be done updated / discussed in a followup PR. Having more tests using the shared script would also make easier to decide where to put the functions or how to name a new file if we create such.

I like this idea. On my todo list there is a small refactoring of the repo (which includes making default repo README more visible). I would like to address this '-lib-' idea as a part of this refactoring.

log-util-tests.sh Fixed Show fixed Hide fixed
'/usr/libexec/anaconda/log-capture' is an util to generate runtime logs.
This commit adds test validating output of this util.
@elkoniu elkoniu changed the title Add test for EFI log processing Add test for log processing Nov 14, 2024
@rvykydal
Copy link
Contributor

/test-os-variants

@rvykydal
Copy link
Contributor

/test-tmt

Copy link
Contributor

@rvykydal rvykydal left a comment

Choose a reason for hiding this comment

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

Looks good to me, thank you.

@elkoniu elkoniu merged commit b1eff61 into rhinstaller:master Nov 19, 2024
5 checks passed
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.

4 participants