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

#213 set maximum build count to display in the archives section #214

Merged
merged 2 commits into from Apr 11, 2022

Conversation

prashanth-sams
Copy link
Owner

Merge checklist

  • TravisCI tests passed
  • Documentation

@prashanth-sams prashanth-sams self-assigned this Apr 8, 2022
@prashanth-sams prashanth-sams added the enhancement New feature or request label Apr 8, 2022
@prashanth-sams prashanth-sams linked an issue Apr 8, 2022 that may be closed by this pull request
@codecov-commenter
Copy link

codecov-commenter commented Apr 8, 2022

Codecov Report

Merging #214 (b290fbe) into master (0c7f0c0) will decrease coverage by 0.430%.
The diff coverage is 18.181%.

@@              Coverage Diff              @@
##            master      #214       +/-   ##
=============================================
- Coverage   26.976%   26.546%   -0.431%     
=============================================
  Files            6         6               
  Lines          645       663       +18     
=============================================
+ Hits           174       176        +2     
- Misses         471       487       +16     

@prashanth-sams
Copy link
Owner Author

note: will fix the issues mentioned in linter

@prashanth-sams
Copy link
Owner Author

note: will add unit test for this module

class HTMLReporter(object):
def __init__(self, path, config):
def __init__(self, path, archive_count, config):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we do in this way?

  • Archive count make as a command line option with some default
  • During HTMLReporter init just take the cmd param value and set this as the archive_count attribute value?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Archive count make as a command line option with some default

  • Yeah I already have that snippet in pytest_addoption method
group.addoption(
        "--archive-count",
        action="store",
        dest="archive_count",
        default="",
        help="set maximum build count to display in the archives section",
    )

During HTMLReporter init just take the cmd param value and set this as the archive_count attribute value?

  • I think I did the same - not sure if I am right. can you please give me the snippet as a rough idea

Copy link
Owner Author

Choose a reason for hiding this comment

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

I actually set empty string as default purposely; cos, we allow archives by default.



def remove_old_archives(path, archive_count):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Probably it's better to make this function as HTMLReporter class method?

Copy link
Owner Author

Choose a reason for hiding this comment

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

@kozakHolota moved inside the HTMLReporter

@kozakHolota kozakHolota merged commit ad20ba9 into master Apr 11, 2022
@kozakHolota kozakHolota deleted the archive-count branch April 11, 2022 07:19
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.

[Archives] Set archives maximum build count to display [Archives] key to enable or disable archives
3 participants