Skip to content

Conversation

remimimimimi
Copy link
Contributor

@remimimimimi remimimimimi commented Oct 3, 2025

Add tests on top of https://github.com/ruben-arts/ros_workspace/ that packages are being built, extra-input-globs are stored in metadata.json file and that file change triggers rebuild.

Cross-dependent on prefix-dev/pixi-build-backends#395.

@remimimimimi remimimimimi force-pushed the feat/ros-backend-tests branch from 2510560 to 28ef57b Compare October 14, 2025 14:45
@remimimimimi remimimimimi force-pushed the feat/ros-backend-tests branch from b07681f to e504199 Compare October 15, 2025 09:11
Copy link
Contributor

@ruben-arts ruben-arts left a comment

Choose a reason for hiding this comment

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

The ROS specificness of this PR looks good to me! @Hofer-Julian could you validate that the testing logic and repo changes are proper?

Copy link
Contributor

@Hofer-Julian Hofer-Julian left a comment

Choose a reason for hiding this comment

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

Valentin and I live-reviewed this. Valentin will review the code himself again, and then I'll have another look

Comment on lines 154 to 165
repodata_files = sorted(
list(temp_dir.rglob("repodata.json"))
+ list(temp_dir.rglob("repodata.json.zst"))
)

console.print(f"[blue]Found {len(backend_executables)} backend executable(s)")

# Extract all executables
for executable in backend_executables:
final_path = output_dir / Path(executable).name
if final_path.exists():
if final_path.is_dir():
shutil.rmtree(final_path)
else:
final_path.unlink()
if not repodata_files:
raise FileNotFoundError(
"Could not locate a channel directory inside the artifact. "
f"Archive contents: {file_list}"
)

zip_ref.extract(executable, output_dir)
extracted_path = output_dir / executable
channel_dir = repodata_files[0].parent.parent
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand this code :)))))

Copy link
Contributor

@Hofer-Julian Hofer-Julian left a comment

Choose a reason for hiding this comment

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

Please adapt the README

@remimimimimi remimimimimi force-pushed the feat/ros-backend-tests branch from dd776fd to 34e1675 Compare October 16, 2025 15:21
@remimimimimi remimimimimi force-pushed the feat/ros-backend-tests branch from 34e1675 to 55d8243 Compare October 16, 2025 15:33
@remimimimimi remimimimimi force-pushed the feat/ros-backend-tests branch from 11be9fb to 559bcb6 Compare October 16, 2025 15:49
This reverts commit 559bcb6.
This reverts commit 55d8243.
This reverts commit 31676ae.
@remimimimimi remimimimimi force-pushed the feat/ros-backend-tests branch from 6c8aa6d to b548c83 Compare October 17, 2025 07:44
@remimimimimi remimimimimi force-pushed the feat/ros-backend-tests branch from bb98e05 to 1544854 Compare October 17, 2025 09:27
Copy link
Contributor

@Hofer-Julian Hofer-Julian left a comment

Choose a reason for hiding this comment

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

We are close!!!!!!!

Comment on lines +111 to +113
if channel_source.exists():
print("🧹 Removing existing channel directory before rebuilding")
shutil.rmtree(channel_source)
Copy link
Contributor

Choose a reason for hiding this comment

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

Not needed anymore

is_windows = sys.platform.startswith("win")

# Find the pixi binary
some_repodata_file = None
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's rename this to is_channel

Comment on lines +33 to +35
env_override = os.environ.get("PIXI_TESTSUITE_BACKEND_CHANNEL")
if env_override:
return env_override
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's remove this env var everywhere

if channel_dir.is_dir() and any(channel_dir.rglob("repodata.json")):
return channel_dir.as_uri()

return None
Copy link
Contributor

Choose a reason for hiding this comment

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

Raise exception instead

Comment on lines +59 to +60
if local_uri is None:
return copied_str
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if local_uri is None:
return copied_str

Comment on lines +74 to +77
try:
data = tomllib.loads(updated)
except Exception:
pass
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't catch exception

return None


def copy_manifest(
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add doc comments

src: str | os.PathLike[str],
dst: str | os.PathLike[str],
*,
follow_symlinks: bool = True,
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's try to remove this

return copied_str


def copytree_with_local_backend(
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be nice to also do this within this function:

# Remove existing .pixi folders
shutil.rmtree(cmake_env_test_project.joinpath(".pixi"), ignore_errors=True)

Afterwards we can remove this rmtree call everywhere

def simple_workspace(
tmp_pixi_workspace: Path,
request: pytest.FixtureRequest,
local_backend_channel_uri: str | None,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
local_backend_channel_uri: str | None,
local_backend_channel_uri: str,

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