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: Add unit tests for org.osbuild.gunzip stage #1689

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

elkoniu
Copy link
Contributor

@elkoniu elkoniu commented Mar 27, 2024

This PR adds unit tests for org.osbuild.gunzip stage.

@elkoniu elkoniu requested a review from mvo5 March 27, 2024 00:08
@elkoniu elkoniu force-pushed the org.osbuild.gunzip-unit-tests branch from 25a93e2 to 160c8c1 Compare March 27, 2024 00:30
Copy link
Contributor

@mvo5 mvo5 left a comment

Choose a reason for hiding this comment

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

Thanks for working on this! A quick first look with some ideas/suggestions

stages/test/test_gunzip.py Show resolved Hide resolved
stages/test/test_gunzip.py Outdated Show resolved Hide resolved
stages/test/test_gunzip.py Outdated Show resolved Hide resolved
stages/test/test_gunzip.py Outdated Show resolved Hide resolved
stages/test/test_gunzip.py Show resolved Hide resolved
stages/test/test_gunzip.py Show resolved Hide resolved
@elkoniu elkoniu force-pushed the org.osbuild.gunzip-unit-tests branch from 160c8c1 to f25e9b9 Compare April 2, 2024 14:36
@elkoniu
Copy link
Contributor Author

elkoniu commented Apr 2, 2024

@mvo5 thanks for the review, I have applied some changes to the code.
I still do not know how I shall process the last assert:

E           AssertionError: expected call not found.
E           Expected: run(['gunzip', '--stdout', '/tmp/test_file.txt.gz'], encoding='utf8', check=True)
E             Actual: run(['gunzip', '--stdout', '/tmp/fake_file.txt.gz'], stdout=<_io.TextIOWrapper name='/tmp/test_file.txt' mode='w' encoding='utf8'>, check=True)

I mean - how to include stdout in the assert python query, or how to discard it.
If I understand correct assert was not expecting that there will be "two" outputs.

@elkoniu elkoniu force-pushed the org.osbuild.gunzip-unit-tests branch from f25e9b9 to 11cd7dd Compare April 8, 2024 09:10
@elkoniu elkoniu marked this pull request as ready for review April 8, 2024 09:10
@elkoniu elkoniu force-pushed the org.osbuild.gunzip-unit-tests branch from 11cd7dd to 6797e7b Compare April 12, 2024 08:52
@mvo5
Copy link
Contributor

mvo5 commented Apr 12, 2024

@mvo5 thanks for the review, I have applied some changes to the code. I still do not know how I shall process the last assert:

E           AssertionError: expected call not found.
E           Expected: run(['gunzip', '--stdout', '/tmp/test_file.txt.gz'], encoding='utf8', check=True)
E             Actual: run(['gunzip', '--stdout', '/tmp/fake_file.txt.gz'], stdout=<_io.TextIOWrapper name='/tmp/test_file.txt' mode='w' encoding='utf8'>, check=True)

I mean - how to include stdout in the assert python query, or how to discard it. If I understand correct assert was not expecting that there will be "two" outputs.

The here here seems to be from "test_file.txt.gz" vs "fake_file.txt.gz" not from the stdout?

Copy link

This PR is stale because it has been open 30 days with no activity. Remove "Stale" label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label May 13, 2024
@mvo5
Copy link
Contributor

mvo5 commented May 13, 2024

@elkoniu Hey, this got the "stale" label now, but all it needs to get merged is a tiny fix in the unit tests (see previous comment). would you mind fixing it so that this can get in?

@elkoniu elkoniu force-pushed the org.osbuild.gunzip-unit-tests branch 2 times, most recently from bf11787 to 97ff022 Compare May 13, 2024 09:00
@elkoniu
Copy link
Contributor Author

elkoniu commented May 13, 2024

@mvo5 thanks for pointing this out, I have just updated the test case so it will not fail anymore :)

@elkoniu elkoniu force-pushed the org.osbuild.gunzip-unit-tests branch 3 times, most recently from 030606c to 3de4929 Compare May 13, 2024 10:43
@elkoniu elkoniu force-pushed the org.osbuild.gunzip-unit-tests branch from 3de4929 to 53db168 Compare May 13, 2024 10:44
@bcl
Copy link
Contributor

bcl commented May 13, 2024

@github-actions github-actions bot removed the Stale label May 14, 2024
Copy link

This PR is stale because it has been open 30 days with no activity. Remove "Stale" label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants