b3b00 / coverlet-action

coverlet github action
MIT License
5 stars 4 forks source link

RangeError: Maximum call stack size exceeded #13

Closed agray closed 1 year ago

agray commented 1 year ago
Run b3b00/coverlet-action@1.[2](https://github.com/Sauceforge/Saucery/actions/runs/4273655280/jobs/7439710011#step:5:2).4
  with:
    testProject: UnitTests/UnitTests.csproj
     output: opencover.xml
     outputFormat: opencover
     threshold: 80
     excludes: [UnitTests]Tests.*,[Saucery]AutoGeneratedProgram,[Saucery]Saucery.Selenium.*, 
   [Saucery]Saucery.Driver.SauceryAndroid*,[Saucery]Saucery.Driver.SauceryIOS*,[Saucery]Saucery.Tests.SauceryAndroid*, 
   [Saucery]Saucery.Tests.SauceryIOS*,[Saucery]Saucery.DataSources.EnvCompositor*,[Saucery]Saucery.Util.WebControl
  env:
    PROJECT_NAME: Saucery
    SOLN_FILE: Saucery.sln
    UT_DIR: UnitTests
    UT_PROJECT: UnitTests/UnitTests.csproj
    EM_PROJECT: ExternalMerlin/ExternalMerlin.csproj
    SAUCE_USER_NAME: ***
    SAUCE_API_KEY: ***
    CONFIG: Release
    APP_PACKAGE_PATH: published
    COVERAGE_FORMAT: opencover
    COVERAGE_FILENAME: opencover.xml
    COVERAGE_THRESHOLD: 80
    DOTNET_ROOT: /home/runner/.dotnet
run dotnet test -c Debug -p:coverletOutput=opencover.xml -p:CollectCoverage=true -p:CoverletOutputFormat=opencover -    p:Exclude=\"[UnitTests]Tests.*,[Saucery]AutoGeneratedProgram,[Saucery]Saucery.Selenium.*,[Saucery]Saucery.Driver.SauceryAndroid*,[Saucery]Saucery.Driver.SauceryIOS*,[Saucery]Saucery.Tests.SauceryAndroid*,[Saucery]Saucery.Tests.SauceryIOS*,[Saucery]Saucery.DataSources.EnvCompositor*,[Saucery]Saucery.Util.WebControl\" UnitTests/UnitTests.csproj
dotnet failed
global error RangeError: Maximum call stack size exceeded
RangeError: Maximum call stack size exceeded
    at ab2str (/home/runner/work/_actions/b[3]    (https://github.com/Sauceforge/Saucery/actions/runs/4273655280/jobs/7439710011#step:5:3)b00/coverlet-action/1.2.[4]    (https://github.com/Sauceforge/Saucery/actions/runs/4273655280/jobs/7439710011#step:5:4)/index.js:8:30)
at assertCoverageThreshold (/home/runner/work/_actions/b3b00/coverlet-action/1.2.4/index.js:33:22)
at Object.<anonymous> (/home/runner/work/_actions/b3b00/coverlet-action/1.2.4/index.js:82:[5]    (https://github.com/Sauceforge/Saucery/actions/runs/4273655280/jobs/7439710011#step:5:5))
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:8[6]    (https://github.com/Sauceforge/Saucery/actions/runs/4273655280/jobs/7439710011#step:5:6)3:32)
at Function.Module._load (internal/modules/cjs/loader.js:[7]    (https://github.com/Sauceforge/Saucery/actions/runs/4273655280/jobs/7439710011#step:5:7)0[8]    (https://github.com/Sauceforge/Saucery/actions/runs/4273655280/jobs/7439710011#step:5:8):14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:[12]    (https://github.com/Sauceforge/Saucery/actions/runs/4273655280/jobs/7439710011#step:5:12))
at internal/main/run_main_module.js:[17]    (https://github.com/Sauceforge/Saucery/actions/runs/4273655280/jobs/7439710011#step:5:17):47
Error: Maximum call stack size exceeded

Please see: https://github.com/Sauceforge/Saucery/actions/runs/4273655280/jobs/7439710011

b3b00 commented 1 year ago

hello @agray , i'm starting to look at it

b3b00 commented 1 year ago

@agray , I'm not able to reproduce your error. unit tests fail with error

A total of 1 test files matched the specified pattern.
Setup failed for test fixture Merlin.OpenSauceTests
System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation.
  ----> System.TypeInitializationException : The type initializer for 'Merlin.RequestedPlatformData' threw an exception.
  ----> System.Collections.Generic.KeyNotFoundException : The given key 'x-ratelimit-remaining' was not present in the dictionary.
  Failed ClickLinkTest [15 ms]
  Error Message:
   OneTimeSetUp: System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation.
  ----> System.TypeInitializationException : The type initializer for 'Merlin.RequestedPlatformData' threw an exception.
  ----> System.Collections.Generic.KeyNotFoundException : The given key 'x-ratelimit-remaining' was not present in the d

So coverlet -action does not even try to extract coverage. Am I missing something to make your tests run. I've got my own trial user/key from saucelabs API to test.

b3b00 commented 1 year ago

@agray could you provide the output of the dotnet test command runned by the action ? this way I may be able to reproduce and try to fix.

The full command to run in your project root dir is

run dotnet test -c Debug -p:coverletOutput=opencover.xml -p:CollectCoverage=true -p:CoverletOutputFormat=opencover -p:Exclude=\"[UnitTests]Tests.*,[Saucery]AutoGeneratedProgram,[Saucery]Saucery.Selenium.*,[Saucery]Saucery.Driver.SauceryAndroid*,[Saucery]Saucery.Driver.SauceryIOS*,[Saucery]Saucery.Tests.SauceryAndroid*,[Saucery]Saucery.Tests.SauceryIOS*,[Saucery]Saucery.DataSources.EnvCompositor*,[Saucery]Saucery.Util.WebControl\" UnitTests/UnitTests.csproj

thanks

b3b00 commented 1 year ago

@agray I've just published v1.2.5 it may fix the issue and allow extra debug info. simply add a debug: true param to coverlet-action in your workflow file (see coverlet-action readme)

agray commented 1 year ago

trying with version 1.2.5 and debug: true https://github.com/Sauceforge/Saucery/actions/runs/4334401649 failed but this worked: https://github.com/Sauceforge/Saucery/actions/runs/4334713671

Pull Request Merge job: https://github.com/Sauceforge/Saucery/actions/runs/4334979904

Wondering if we have an intermittent issue?

b3b00 commented 1 year ago

The first build (https://github.com/Sauceforge/Saucery/actions/runs/4334401649) failed because there were 3 unit test that failed. It 's not an issue wirth coverlet-action per se. Two others seem to demonstrate that the fix.... fixes your issue. Think about removing the debug flag as it cluttered the build output.

Thanks for reporting and helping solve the issue.