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

chore(shim): add unit tests for shim parsing #9248

Merged
merged 2 commits into from
Oct 15, 2024

Conversation

chris-olszewski
Copy link
Member

@chris-olszewski chris-olszewski commented Oct 11, 2024

Description

I was looking at hoisting daemon detection up to shim level so we could avoid reloading a filtered tracing layer. This ended up not being the solution I wanted, but I figured I should add the tests that I added.

⚠️ This PR does have an extremely minor behavior change. See this comment

Testing Instructions

Unit tests pass

Copy link

vercel bot commented Oct 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-nonmonorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 11, 2024 5:08pm
8 Skipped Deployments
Name Status Preview Comments Updated (UTC)
examples-basic-web ⬜️ Ignored (Inspect) Oct 11, 2024 5:08pm
examples-designsystem-docs ⬜️ Ignored (Inspect) Oct 11, 2024 5:08pm
examples-gatsby-web ⬜️ Ignored (Inspect) Oct 11, 2024 5:08pm
examples-kitchensink-blog ⬜️ Ignored (Inspect) Oct 11, 2024 5:08pm
examples-native-web ⬜️ Ignored (Inspect) Oct 11, 2024 5:08pm
examples-svelte-web ⬜️ Ignored (Inspect) Oct 11, 2024 5:08pm
examples-tailwind-web ⬜️ Ignored (Inspect) Oct 11, 2024 5:08pm
examples-vite-web ⬜️ Ignored (Inspect) Oct 11, 2024 5:08pm

@@ -56,6 +56,14 @@ pub struct ShimArgs {

impl ShimArgs {
pub fn parse() -> Result<Self, Error> {
let invocation_dir = AbsoluteSystemPathBuf::cwd()?;
Copy link
Member Author

Choose a reason for hiding this comment

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

We make this call here so testing is easier. It also means we avoid calling std::env::current_dir once for each --cwd flag and reuse this value.

The only behavior change from this move is that if you:

  • pass the args turbo --cwd
  • Execute turbo in a directory where current_dir would fail (process doesn't have permission to access cwd or cwd doesn't exist)
    Then we will now report the current_dir failure instead of complaining that you didn't pass a value for the --cwd flag.

@chris-olszewski chris-olszewski marked this pull request as ready for review October 11, 2024 17:15
@chris-olszewski chris-olszewski requested a review from a team as a code owner October 11, 2024 17:15
@chris-olszewski chris-olszewski merged commit f5323be into main Oct 15, 2024
40 checks passed
@chris-olszewski chris-olszewski deleted the olszewski/chore_shim_parsing branch October 15, 2024 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants