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/run_action_tests #1674

Merged
merged 4 commits into from
Nov 27, 2023
Merged

Fix/run_action_tests #1674

merged 4 commits into from
Nov 27, 2023

Conversation

worksofliam
Copy link
Contributor

@worksofliam worksofliam commented Nov 21, 2023

Changes

  • Provides fix for runAction where a prompt to ask the user if they want to see the output log was actually causing the API to never return until the user chose their option. This was stopping the action tests from running.
  • Fix for postDownload not downloading files in the root correctly.

Checklist

  • have tested my change
  • updated relevant documentation
  • Remove any/all console.logs I added
  • eslint is not complaining
  • have added myself to the contributors' list in CONTRIBUTING.md
  • for feature PRs: PR only includes one feature enhancement.

@worksofliam worksofliam marked this pull request as draft November 21, 2023 20:48
@worksofliam
Copy link
Contributor Author

@sebjulliand Might need a hand looking at this bug with postDownload. I created a test case where I can recreate it.

Perhaps this is a Mac vs Windows thing?

Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
@sebjulliand
Copy link
Collaborator

So...there was a couple of issues there.

  • getFile / getDirectory / ... and all these methods don't like Windows path starting with a /. I fixed that in one place a while ago, so I moved the logic in one place and made sure every download/upload operation uses the correct method.
  • The Action's post download process had multiple flaws in the logic (my bad!). Now, the type of what's downloaded is retrieved beforehand and local directories are created accordingly.
  • We await for the downloads to end before returning from runAction (we used to not wait).
  • The post download test tested the wrong file

I tested uploads and downloads all around and it all seems good. The post downloads are OK and the test runs fine.
@worksofliam hopefully it's still OK on Mac 😝 You'll tell me.

@worksofliam worksofliam marked this pull request as ready for review November 27, 2023 15:07
@worksofliam
Copy link
Contributor Author

@sebjulliand Looks like the postDownload test is failing here:

image
{
  errno: -21,
  code: "EISDIR",
  syscall: "open",
  path: "/Users/barry/Downloads/ics/hello.txt",
  vslsStack: [
  ],
}
"EISDIR: illegal operation on a directory, open '/Users/barry/Downloads/ics/hello.txt'"

postDownloads looks like this:

[
  {
    remotePath: "/tmp/vscodetemp-O_TJcXiWA6/hello.txt",
    localPath: "/Users/barry/Downloads/ics/hello.txt",
    type: 1,
  },
  {
    remotePath: "/tmp/vscodetemp-O_TJcXiWA6/random/",
    localPath: "/Users/barry/Downloads/ics/random/",
    type: 2,
  },
]

@sebjulliand
Copy link
Collaborator

Bloody hell...more Windows/POSIX discrepencies 😅 I'll check it out tomorrow.

@worksofliam
Copy link
Contributor Author

@sebjulliand I am looking into it now. Doesn't make much sense because your code makes sense.

@worksofliam
Copy link
Contributor Author

@sebjulliand what if I told you I had a directory named hello.txt from before I created this PR? 😂

@worksofliam
Copy link
Contributor Author

Looking good!

image

@worksofliam
Copy link
Contributor Author

@sebjulliand I am happy with this so I am going to merge. Thanks for solving this so quickly!

@worksofliam worksofliam merged commit a23cb6a into master Nov 27, 2023
1 check passed
@sebjulliand sebjulliand deleted the fix/run_action_tests branch November 27, 2023 18:39
@sebjulliand
Copy link
Collaborator

@sebjulliand I am happy with this so I am going to merge. Thanks for solving this so quickly!

You're welcome. You got me laughing there 🤣

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.

Confirm postDownload not downloading files in the root correctly
2 participants