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

fix: add pebble log targets and checks to testing plan #1111

Conversation

PietroPasotti
Copy link
Contributor

Issue: adding a layer with checks or log-targets isn't reflected in the plan you obtain when testing through get_plan()

solution: make it reflect

@tonyandrewmeyer
Copy link
Contributor

Thanks! My bad for missing log targets in #1074.

@tonyandrewmeyer tonyandrewmeyer requested review from tonyandrewmeyer and benhoyt and removed request for tonyandrewmeyer January 18, 2024 08:42
@tonyandrewmeyer tonyandrewmeyer changed the title add pebble log targets and checks to testing plan fix: add pebble log targets and checks to testing plan Jan 18, 2024
Copy link
Collaborator

@benhoyt benhoyt left a comment

Choose a reason for hiding this comment

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

A few comments here. Mainly small things, and the test should move.

Additionally, type checking and tests are failing.

ops/testing.py Outdated Show resolved Hide resolved
ops/testing.py Outdated
for key in sorted(self._layers.keys()):
layer = self._layers[key]
for name, service in layer.services.items():
# TODO: (jam) 2021-04-07 have a way to merge existing services
services[name] = service
services[name] = service.to_dict()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm, not an issue with this PR, but looking at this code made me realize we're not even attempting to combine layers correctly here. We already have the code to combine a layer (in _TestingPebbleClient.add_layer), we just need to use it here as well.

We also have pebble.Service._merge, but we'll need similar _merge methods on pebble.Check and pebble.LogTarget and update appropriately to merge those blocks as well.

I think we can leave it "broken" in this PR (it's already broken now, so this doesn't make it worse), but I've opened #1112 to track.

ops/testing.py Outdated Show resolved Hide resolved
ops/testing.py Outdated Show resolved Hide resolved
test/test_pebble.py Outdated Show resolved Hide resolved
test/test_pebble.py Outdated Show resolved Hide resolved
test/test_pebble.py Outdated Show resolved Hide resolved
test/test_pebble.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@benhoyt benhoyt 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 the updates. Couple of small changes requested, and then we're good to go.

ops/testing.py Outdated Show resolved Hide resolved
ops/testing.py Outdated Show resolved Hide resolved
ops/testing.py Outdated Show resolved Hide resolved
ops/testing.py Outdated Show resolved Hide resolved
ops/testing.py Outdated Show resolved Hide resolved
test/test_testing.py Outdated Show resolved Hide resolved
@PietroPasotti PietroPasotti force-pushed the pebble-plan-include-checks-and-log-targets branch from 4168e63 to 269a0e7 Compare January 30, 2024 09:21
@benhoyt benhoyt merged commit 4678130 into canonical:main Jan 30, 2024
26 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.

3 participants