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

Tools exec wrappers #107

Merged
merged 2 commits into from
Oct 22, 2024
Merged

Tools exec wrappers #107

merged 2 commits into from
Oct 22, 2024

Conversation

tuler
Copy link
Member

@tuler tuler commented Oct 21, 2024

This creates wrappers for the external tools we use in the CLI.
Each publishes a version method to report a SemVer, which we can use to check the minimum version in the execution itself, or in a doctor command.
I've setup the integration tests to use the cartesi/sdk:0.11.0 docker image as fallback, as I'm not sure what is installed in the CI environment.

Copy link

changeset-bot bot commented Oct 21, 2024

⚠️ No Changeset found

Latest commit: f8ca692

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

github-actions bot commented Oct 21, 2024

Coverage Report for ./apps/cli

Status Category Percentage Covered / Total
🔵 Lines 9.28% 66 / 711
🔵 Statements 9.17% 66 / 719
🔵 Functions 6.12% 6 / 98
🔵 Branches 9.06% 29 / 320
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
apps/cli/src/exec/cartesi-machine.ts 75% 50% 50% 75% 14, 31, 33
apps/cli/src/exec/crane.ts 66.66% 50% 50% 66.66% 13-17, 25
apps/cli/src/exec/genext2fs.ts 60% 62.5% 25% 63.15% 8-14, 24-30, 41-47, 66
apps/cli/src/exec/mksquashfs.ts 61.9% 62.5% 25% 65% 8-16, 25-29, 39-48, 69-70, 72
apps/cli/src/exec/util.ts 76.47% 68.18% 100% 76.47% 53, 56, 81-83, 104-108, 112-113, 116
Generated in workflow #193 for commit f8ca692 by the Vitest Coverage Report Action

Copy link
Contributor

@endersonmaia endersonmaia left a comment

Choose a reason for hiding this comment

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

To improve test coverage, we should be able to force the docker execution even if we have the binary on the host system.

export type ExecaOptionsDockerFallback = Options & { image?: string, dockerOnly?: bool };

apps/cli/src/exec/genext2fs.ts Outdated Show resolved Hide resolved
apps/cli/src/exec/mksquashfs.ts Outdated Show resolved Hide resolved
@tuler
Copy link
Member Author

tuler commented Oct 21, 2024

we should be able to force the docker execution

done

@tuler tuler changed the title feat(cli): tools exec wrappers Tools exec wrappers Oct 21, 2024
Copy link
Contributor

@endersonmaia endersonmaia left a comment

Choose a reason for hiding this comment

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

Approving so we move one, but we stiil need to use the exec wrapper elsewhere in the code, right?

@tuler
Copy link
Member Author

tuler commented Oct 22, 2024

Approving so we move one, but we stiil need to use the exec wrapper elsewhere in the code, right?

Right.
I also have an idea to maybe drop the integration tests of driving building, and do as integration tests of genext2fs, mksquashfs, etc, directly

@tuler tuler merged commit a4efd5b into feature/cli-v2 Oct 22, 2024
2 checks passed
@tuler tuler deleted the feature/exec-wrappers branch October 22, 2024 13:54
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.

2 participants