MethodsAndPractices / vsteam

PowerShell module for accessing Azure DevOps Services and Azure DevOps Server (formerly VSTS or TFS)
https://methodsandpractices.github.io/vsteam-docs/
MIT License
447 stars 155 forks source link

Integration Tests are hanging = no releases possible currently #424

Closed SebastianSchuetze closed 2 years ago

SebastianSchuetze commented 2 years ago

There seems to be a problem with the Test Stage. Artifacts cannot be downloaded, and new release would be blocked. Working on it currently, but I don't exactly know what the problem is.

Example: https://loecda.visualstudio.com/Team%20Module/_build/results?buildId=2612&view=logs&j=05c5a9c3-2da3-52a6-f69b-c4ac425f9d8a&t=46d9c746-5393-5699-861f-09f1563ec7d5

Funny thing is. If I used the same scripts locally that fail, there or recreate the pipeline in my own organization. It does not cause any problems...

brittandeyoung commented 2 years ago

I may be able to take a look at this. Is there a reason you are publishing the nuget package to a feed for this kind of testing instead of just using a pipeline artifact? @SebastianSchuetze

SebastianSchuetze commented 2 years ago

It is @DarqueWarrior idea. The general idea was to simulate the PowerShell gallery installation with "Install-Module" it would be good to simulate that as well. We had at some point problems with some users when they installed it from PS Gallery and we wanted to test this to not deploy something that does not work.

We started even to migrate the pipeline to GitHub Actions. But in Github actions we don't have a nuget feed V2 anymore which is needed for PS Module feeds.

So I figured two options to mitigate that:

  1. use a container lokaly hosting such a simple feed for a short instalation test
  2. use a local folder feed (via registering a folder as a package feed) which is not the same as having a real feed

Long story short. Either you

But either way. If you can solve it, it would be of great help!!

brittandeyoung commented 2 years ago

I made the following PR to your pipeline hotfix branch: https://github.com/MethodsAndPractices/vsteam/pull/427

This migrates the installation of the module to use the artifact already in the pipeline. This will only affect the integration tests.

But now that I see you Would prefer to use a nuget feed for testing purposes. I will see what I can do on the actions branch. I will be able to do testing on this branch?

SebastianSchuetze commented 2 years ago

When you make a fork you should be able to run everything with your repo. You just need to recreate some of the resources like environments. As far as it comes to the integration test you could just integrate those for the Cloud Version. But if you come as far as using a local nugget server feed that would already help.

brittandeyoung commented 2 years ago

@SebastianSchuetze Here is as far as I am able to take it without spinning up an Azure DevOps organization. I Also had to resort to using a local Nuget feed as I did not have the credentials for the GitHub Project feed.

I also found the logic for setting the build number in the semantic version was appending this number instead of properly updating the existing build number. I fixed this to update the build number.

https://github.com/MethodsAndPractices/vsteam/pull/429

Please let me know what you think.

Link to actions run getting past the Module Install: https://github.com/brittandeyoung/vsteam/actions/runs/1485308715

SebastianSchuetze commented 2 years ago

@brittandeyoung thanks for your help again. I was able to run integration tests successfully. There where numerous bigs somewhere in the pipeline itself (before).

So really thank you for helping: https://github.com/MethodsAndPractices/vsteam/actions/runs/1512473303

Another questionm. Do you have an idea to simplify the script? We are downloading the dependecies as well and I was thinking if we can prevent that (e.g. when publishing the nuget package as a module.

SebastianSchuetze commented 2 years ago

image

Just have to publish to PS gallery now.