projectkudu / kudu

Kudu is the engine behind git/hg deployments, WebJobs, and various other features in Azure Web Sites. It can also run outside of Azure.
Apache License 2.0
3.12k stars 652 forks source link

Grunt test and Phantomjs - the port number #1306

Closed xied75 closed 6 months ago

xied75 commented 10 years ago

Dear all, Sorry if this is already answered somewhere, I Bing(ed) a lot but still not clear the issue.

Basically I start with Yeoman (Webapp generator) to scaffolding my website, in it there is Grunt -> Grunt Mocha -> Phantomjs for testing.

I then used Azure Cli to create the Deploymentscript and did the changes to fire Bower and Grunt before Kudu Sync.

The trouble is, when the Grunt is calling test, it show something like this:

Running "connect:test" (connect) task
Started connect web server on http://127.0.0.1:9001

Running "mocha:all" (mocha) task
Testing: http://127.0.0.1:9001/index.html

On my local machine, it will continue the grunt tasks, to build the dist folder; but on Azure Website, it hangs there, eventually timeout at 61 seconds.

I tried to change the 9001 to process.env.PORT, still hang.

So I wonder is this something to do with we can't listen on a port? But then I saw this http://www.hanselman.com/blog/HowToInstallTheNodejsGhostBloggingSoftwareOnAzureWebsites.aspx

Totally confused now. Somebody help!

Best regards,

Dong

davidebbo commented 10 years ago

I think the core issue here is that within an Azure Website, you cannot listen on a socket. See some of the restrictions described here.

See also a few other issues that relate to Phantomjs.

xied75 commented 10 years ago

Hi, David, thanks for answering very fast. So if the socket can't be listened to, that means the usual JavaScript testing before deployment would never work? Then this breaks the effort trying to do Continuous Deployment. Any chance this sandbox could provide some Virtualisation abilities. How is the Azure Web Sites team see this?

Regarding Phantomjs, I think it currently works, I can see GDI+ dll from Kudu; I did try some Phantomjs examples by calling the exe file, e.g. I did get a ColorWheel png generated.

Best,

Dong

davidebbo commented 10 years ago

Hi Dong. I agree that the limitation is not ideal and prevents some test framework workflows. Hopefully, this is something we'll be able to address in the future.

The GDI restriction is not all or nothing, so some things do work, and we've been moving the line of what works over time.

Sorry that I don't have a better answer for you at this time! Maybe others have found clever ways to make this work.

jvano commented 6 months ago

Hi

Kudu will continue to run in Azure App Service. However, this repo will no longer be maintained. If the problem persists and is related to running on Azure App Service, please open a support incident in Azure: https://learn.microsoft.com/en-us/azure/azure-portal/supportability/how-to-create-azure-support-request

This way we can better track and assist you on this case

Thanks,

Joaquin Vano Azure App Service