Skip to content

Conversation

@bepri
Copy link
Member

@bepri bepri commented Apr 7, 2025

  • Have you followed the guidelines for contributing?
  • Have you signed the CLA?
  • Have you successfully run make lint && make test?

@bepri bepri self-assigned this Apr 7, 2025
Copy link
Contributor

@mr-cal mr-cal 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, I have no concerns with the direction of this. I'm curious to see the spread tests run.

@bepri bepri force-pushed the work/craft-app-5/CRAFT-4412 branch from b4fc703 to 50c24df Compare April 10, 2025 00:36
@lengau lengau force-pushed the work/craft-app-5/CRAFT-4412 branch from 1547a9c to 45b17b2 Compare April 10, 2025 13:13
bepri and others added 6 commits April 10, 2025 09:32
A restore script that fails to run has the side effect of killing the entire
worker, meaning that a whole bunch of tests get aborted.
This is temporary while we fix the issue related to the build plan rejecting
the ':' notation.
Copy link
Collaborator

@tigarmo tigarmo left a comment

Choose a reason for hiding this comment

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

looks great :)
thanks a lot


@pytest.fixture
def project_keys(request: pytest.FixtureRequest) -> dict[str, Any]:
"""Fixture to modify the default project as needed.
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍🏾

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hol'up really?

I ask because when @bepri and I were writing it I thought you would have the most/best ideas for improvements.

Context: I really want to add a fixture like this to craft-application's pytest plugin so we can have a uniform way to generate projects, and this was a first attempt. (The craft-application one would come with some serious docs about setting up your app's tests)

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm totally game for doing a craft-app design of such a fixture, but this is plenty good for what we need now (which is to merge this PR)

bepri and others added 4 commits April 10, 2025 14:03
These tests manipulate the docker snap itself, so let's run them last so that
they don't leave a broken system for the next tests.
The test itself just needs to build, it doesn't matter whether it's priming or
packing - and there's currently an unrelated bug with 'prime'.
lengau and others added 8 commits April 10, 2025 17:54
Co-authored-by: Tiago Nobrega <tiago.nobrega@canonical.com>
The schema is now stricter than what the application supports for `platform`
entries.
There is something wrong with the test that needs to be investigated: it times
out when packing the rock, and then the 'restore' script times out when cleaning
the lxd instance.
@tigarmo tigarmo marked this pull request as ready for review April 10, 2025 23:33
@tigarmo tigarmo requested a review from medubelko as a code owner April 10, 2025 23:33
@tigarmo tigarmo requested a review from mr-cal April 10, 2025 23:36
Copy link
Contributor

@medubelko medubelko left a comment

Choose a reason for hiding this comment

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

Approving, but I'm not involved in testing this...

build_plan = self._services.get("build_plan").plan()

if len(self._build_plan) > 1:
if len(build_plan) > 1:

Choose a reason for hiding this comment

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

minor consistency issue, but above you do != 1 (https://github.com/canonical/rockcraft/pull/856/files#diff-1c50437519bc7c33b649e77b5197022dadb1baad316acc13d1822c1a7cb6f327R72)

I am not certain about the behavior of len being 0 here though, for which this raised error would be incorrect

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll change the other one to be > 1 as it's more semantically clear what we're checking and why, imo.

Copy link
Collaborator

Choose a reason for hiding this comment

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

do that in a separate PR later please
no more work on this unless it's absolutely necessary

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, alright, I'll leave it be then

if len(self._build_plan) != 1:
build_plan = self._services.get("build_plan").plan()

if len(build_plan) != 1:

Choose a reason for hiding this comment

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

1 for the raised error to make sense, not sure what happens when this is 0

Copy link
Member Author

Choose a reason for hiding this comment

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

It looks like upstream will raise an error for us if there's no plans:
https://github.com/canonical/craft-application/blob/main/craft_application/services/buildplan.py#L63

Copy link

@sergiusens sergiusens left a comment

Choose a reason for hiding this comment

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

Large, looks good 🤜 🤛 , did some fly by comments.

Caution

But this was not an 8 🤦‍♂️

@tigarmo tigarmo added the squash label Apr 11, 2025
@tigarmo tigarmo merged commit 2139bcd into main Apr 11, 2025
15 of 19 checks passed
@tigarmo tigarmo deleted the work/craft-app-5/CRAFT-4412 branch April 11, 2025 13:21
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.

7 participants