Closed johanparmar closed 1 year ago
@johanparmar Could you post the contents of the build script as well as the build log from GitHub Actions?
Hi, Thanks for your help! Here comes the build script
var target = Argument("target", "Test");
var configuration = Argument("configuration", "Release");
//////////////////////////////////////////////////////////////////////
// TASKS
//////////////////////////////////////////////////////////////////////
Task("Clean")
.WithCriteria(c => HasArgument("rebuild"))
.Does(() =>
{
DotNetClean("./AlgoCharging.sln", new DotNetCleanSettings
{
Configuration = configuration,
});
});
Task("Build")
.IsDependentOn("Clean")
.Does(() =>
{
DotNetBuild("./AlgoCharging.sln", new DotNetBuildSettings
{
Configuration = configuration,
});
});
Task("Test")
.IsDependentOn("Build")
.Does(() =>
{
DotNetTest("./AlgoCharging.sln", new DotNetTestSettings
{
Configuration = configuration,
NoBuild = true,
});
});
//////////////////////////////////////////////////////////////////////
// EXECUTION
//////////////////////////////////////////////////////////////////////
RunTarget(target);
FYI
I had to cancel the workflow because it never ends. I have started suspect that it is something with the tests when they are run in GitHub action. I never see this when I run the cake script locally.
@johanparmar By looking at the build log, I would guess that the MongoDB tests are the culprit. If the tests pass locally but hang when running on GitHub Actions, it might be some networking problem. Are you perhaps trying to connect to a MongoDB instance as part of your tests?
We have some tests that access the DB but should be skipped . I also see that we have mixed unit and xunit. I'll check this and let you know how it goes. Thanks!
Hi,
I have tried it again making sure I skip the database tests by skipping them but I still get the same issue. I can see in the attached log that the first test project (CapacityOptimizer.UnitTests) is never run til the end before another one starts. After all test projects has been run except for the one mentioned above it hangs again and I have to cancel the workflow. I have attached the log file as well
I ran the the action again and then it worked. Attaching the log file here
Hi, The issue I was experiencing did not have todo with the cake-action. I found solution here: https://github.com/dotnet/sdk/issues/27106 which basically disables parallel execution of tests
Thanks for assistance !
Hi,
I'm running into issues that the following script hangs sometimes when trying to run the cake script step. The action never finishes
Any ideas what might be reason