Hi! Windows tests are failing on my <PR> and I'm n...
# contributing
r
Hi! Windows tests are failing on my PR and I'm not really sure why. How can I debug this locally on Ubuntu?
w
How can I debug this locally on Ubuntu?
A virtual machine is probably your best bet. I've got one ready, so I'll take a look at the failing tests.
r
Thanks! πŸ™‚ I'll have a look into that. Would it be possible with a Windows image using Docker as an alternative?
w
Docker is only able to virtualize userspace, so you need to have Docker installed on Windows to run a Windows image with Docker.
When you run a non-Windows Docker image on Windows, it uses WSL2
Which is basically a VM
The issue seems to be that the
root
attribute of
Project
instances is being set to a relative path, when it should be an absolute path.
Project.__init__
does
self.root = Path(root).resolve()
, but that doesn't work properly on older versions of Python on Windows: https://github.com/python/cpython/issues/82852
This only is a problem now because previously no
Project
instance was created prior to calling
mkdir
for the new project directory. I'll leave my suggested fix in the PR.
r
Docker is only able to virtualize userspace, so you need to have Docker installed on Windows to run a Windows image with Docker.
Got it, thanks.
This only is a problem now because previously no Project instance was created prior to calling mkdir for the new project directory. I'll leave my suggested fix in the PR.
Ah, I see... Thanks, I'll respond on the PR also. Appreciate your help. 😎
I wish GitHub would let me add PR suggestions anywhere
t
I wish GitHub would let me add PR suggestions anywhere
right? especially if there are already changes in the file!
r
I wish you could accept multiple suggestions together as one commit...
t
@Reuben (Matatika) I think you can… You can add suggestions to a batch (at least we can as project members)…
r
...yes, you're right. πŸ˜…
t
Don’t say I never solved a problem for you @Reuben (Matatika) πŸ˜‰ πŸ˜„
r
I'll add it to the list πŸ˜‰
All tests passing again after code review changes + a few modifications. Thanks guys! 😎 Ready for a final review now whenever you're ready.
@Will Da Silva (Arch) If you have a second, do you mind sharing how you have your Windows VM set up with Meltano? I installed VirtualBox last night and created a Windows 10 VM, but have never done any development on Windows.
w
Microsoft provides free Windows 11 dev-ready virtual machine images with an expiration date: https://developer.microsoft.com/en-us/windows/downloads/virtual-machines/ I install one of these with VirtualBox, and then for development I use Powershell as an admin. Super+x is a keyboard shortcut that will let you drop right into an admin Powershell session. I'll use
notepad
to edit text files for minor changes, and if I need to do anything significant I'll install VS Code. I believe Chocolatey (https://chocolatey.org/) comes pre-installed - it's pretty useful for e.g. installing Python:
Copy code
choco install python3 --version=3.10.8 --yes --force --no-progress
refreshenv
Vcpkg (https://github.com/microsoft/vcpkg) may be needed if you have C/C++ dependencies. If Powershell complains about what execution policies you can run
Set-ExecutionPolicy Bypass -Force
to get around that. Don't get too attached to this development environment, since the VM has an expiration date. Feel free to mess it up since you can always start fresh with a new one. As for Meltano itself, since you're running as an admin and Python has cross-platform support you shouldn't run into much trouble.
r
@Will Da Silva (Arch) This is really helpful, thank you! Chocolatey sounds like the Windows version of Homebrew, so that might be easy to pick up. I mostly want a dev environment to check Windows compatibility with any file system-related changes I'm making to Meltano (usually with
pathlib
). This is gonna be much better than waiting for GitHub Actions CI to tell me if things do/don't work on Windows! Appreciate you taking the time out, thanks. πŸ™‚