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

Unit tests using Pytest for action_inputs.py. #43

Merged
merged 63 commits into from
Oct 31, 2024

Conversation

MobiTikula
Copy link
Collaborator

@MobiTikula MobiTikula commented Oct 15, 2024

Implement unit tests using pytest for action inputs file.

  • unit tests
  • for observation of code coverage by unit tests use pytest-cov.
  • goal is 80+% score.

Release Notes:

  • Unit tests using Pytest for action_inputs.py file.

…lint settings updated with not checking test files.
…and-Code-Coverage' into feature/34-Introduce-Unit-Tests-and-Code-Coverage
@MobiTikula MobiTikula changed the base branch from master to feature/34-Introduce-Unit-Tests-Model-Folder October 15, 2024 10:17
@MobiTikula
Copy link
Collaborator Author

Release Notes:

  • unit tests using Pytest for action_inputs.py file

@MobiTikula MobiTikula self-assigned this Oct 15, 2024
@MobiTikula MobiTikula added the work in progress Work on this item is not yet finished (mainly intended for PRs) label Oct 15, 2024
Base automatically changed from feature/34-Introduce-Unit-Tests-Model-Folder to master October 16, 2024 09:59
@MobiTikula MobiTikula added enhancement New feature or request and removed work in progress Work on this item is not yet finished (mainly intended for PRs) labels Oct 22, 2024
@MobiTikula MobiTikula changed the title Feature/34 introduce unit tests action inputs Unit tests using Pytest for action_inputs.py. Oct 23, 2024
Copy link
Collaborator

@miroslavpojer miroslavpojer left a comment

Choose a reason for hiding this comment

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

  • pulled
  • unit tests run
  • code review
  • local run performed

living_documentation_generator/action_inputs.py Outdated Show resolved Hide resolved
living_documentation_generator/action_inputs.py Outdated Show resolved Hide resolved
tests/test_action_inputs.py Outdated Show resolved Hide resolved
tests/test_action_inputs.py Show resolved Hide resolved
tests/test_action_inputs.py Show resolved Hide resolved
living_documentation_generator/generator.py Show resolved Hide resolved
Copy link
Collaborator

@miroslavpojer miroslavpojer left a comment

Choose a reason for hiding this comment

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

  • pulled
  • code review
  • run tests
  • run local script

@@ -125,10 +125,15 @@ def validate_inputs(out_path: str) -> None:
# Check that the INPUT_OUTPUT_PATH is not a project directory
# Note: That would cause a rewriting project files
project_directories = get_all_project_directories()
if DEFAULT_OUTPUT_PATH in project_directories:
project_directories.remove(DEFAULT_OUTPUT_PATH)
default_abspath_output_path = os.path.abspath(DEFAULT_OUTPUT_PATH)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do you here work with constant value instead of user's input?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I worked with constant default, because the file can be created without user knowing. I still think, it should be kept there. So first option is to check as well if there is already an user's input OR you mentioned few weeks ago, that there is no point to remove these files at all, since it will be run only once on the GH everytime.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

After the discussion, the change is fixed in commit: af039ef.

@MobiTikula MobiTikula merged commit a17b3b9 into master Oct 31, 2024
3 of 4 checks passed
@MobiTikula MobiTikula deleted the feature/34-Introduce-Unit-Tests-Action-Inputs branch October 31, 2024 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants