Running an external process while executing unit tests

Sean Feldman's Avatar

Sean Feldman

31 May, 2020 02:50 AM

Is it possible to start a process and keep it running while executing unit tests phase?

Specifically, I need to run Azurite (Storage emulator replacement) and my tests need to talk to it (127.0.0.1:10000). I've modified the script to start the process during before_tests phase (link) but it doesn't look like the process is running when tests are executed (link).

Is what I'm attempting possible (keeping the process running during the whole testing phase)?

  1. Support Staff 1 Posted by Feodor Fitsner on 01 Jun, 2020 06:09 PM

    Feodor Fitsner's Avatar

    Hi Sean,

    That's absolutely possible and the way you are doing that in PS looks legit to me.

    Try adding Get-Process to see what's being run and maybe netstat -a -b would help to see what's listening as well. Also, looking via RDP what's going on during Azurite start (e.g. asking for firewall permissions) might help.

  2. 2 Posted by Sean Feldman on 01 Jun, 2020 11:37 PM

    Sean Feldman's Avatar

    Thank you, Feodor.

    I took your suggestion and ran Get-Process after Azurite NPM package is installed.
    Interesting enough, the npm process that executes Azurite is not listed. Locally, it's showing up. So I wonder if this is an issue with how the NPM package is installed, npm install -g azurite. With -g it will be a global package. Can you confirm that AppVeyor would be able to run it?

  3. Support Staff 3 Posted by Feodor Fitsner on 01 Jun, 2020 11:45 PM

    Feodor Fitsner's Avatar

    Of course, build is running with administrative privileges.

    After installing azurite as a global package how do you start it from command line? I suspect your Start-Process call is not correct. Try running it through Start-Process locally.

  4. 4 Posted by Sean Feldman on 02 Jun, 2020 03:07 AM

    Sean Feldman's Avatar

    Feodor, I'm ashamed to admit, I've made a stupid mistake.

    When invoking Start-Process azurite-blob, PowerShell finds the azurite-blob file, which is a bash shell and does nothing with it (open the file). Windows equivalent is azurite-blob.cmd. The extension .cmd was necessary. This will teach me a lesson to pay attention to extensions. Thank you.

  5. Sean Feldman closed this discussion on 02 Jun, 2020 03:07 AM.

  6. Feodor Fitsner re-opened this discussion on 02 Jun, 2020 03:32 AM

  7. Support Staff 5 Posted by Feodor Fitsner on 02 Jun, 2020 03:32 AM

    Feodor Fitsner's Avatar

    Cool, thanks for the update!

  8. Feodor Fitsner closed this discussion on 02 Jun, 2020 03:32 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

02 Jul, 2020 03:24 PM
01 Jul, 2020 08:32 PM
01 Jul, 2020 01:12 PM
30 Jun, 2020 04:26 PM
25 Jun, 2020 05:54 PM