You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Output from azd version
azd version 1.0.0 (commit ed2244c)
Describe the bug
I have added unit testing in my Dockerfile. When I run the docker file locally, I see the test failing. However, I don't see it when it run it in GitHub workflows.
error I see when I run the Dockerfile locally
ERROR [build 14/18] RUN dotnet test "/src/tests/GlyphEditor.Tests/GlyphEditor.Tests.csproj" --logger "trx;LogFileName=testresults.trx" 6.9s
[build 14/18] RUN dotnet test "/src/tests/GlyphEditor.Tests/GlyphEditor.Tests.csproj" --logger "trx;LogFileName=testresults.trx": #22 0.826 Determining projects to restore... #22 1.558 All projects are up-to-date for restore. #22 3.427 GlyphEditor.Data.Abstractions -> /src/src/GlyphEditor.Data.Abstractions/bin/Debug/net7.0/GlyphEditor.Data.Abstractions.dll #22 3.837 GlyphEditor.Data.Postgres -> /src/src/GlyphEditor.Data.Postgres/bin/Debug/net7.0/GlyphEditor.Data.Postgres.dll #22 4.671 GlyphEditor.Api -> /src/src/GlyphEditor.Api/bin/Debug/net7.0/GlyphEditor.Api.dll #22 5.114 GlyphEditor.Integration.Tests -> /src/tests/GlyphEditor.Integration.Tests/bin/Debug/net7.0/GlyphEditor.Integration.Tests.dll #22 5.376 GlyphEditor.Tests -> /src/tests/GlyphEditor.Tests/bin/Debug/net7.0/GlyphEditor.Tests.dll #22 5.384 Test run for /src/tests/GlyphEditor.Tests/bin/Debug/net7.0/GlyphEditor.Tests.dll (.NETCoreApp,Version=v7.0) #22 5.483 Microsoft (R) Test Execution Command Line Tool Version 17.6.0 (x64) #22 5.483 Copyright (c) Microsoft Corporation. All rights reserved. #22 5.487 #22 5.555 Starting test execution, please wait... #22 5.582 A total of 1 test files matched the specified pattern. #22 6.675 Failed Should_upload_file_csv [61 ms] #22 6.675 Error Message: #22 6.675 Assert.Fail failed. test failed #22 6.675 Stack Trace: #22 6.675 at GlyphEditor.Tests.Storage.AzureBlobStorageTests.Should_upload_file_csv() in /src/tests/GlyphEditor.Tests/Storage/AzureStorageTests.cs:line 36 #22 6.675 #22 6.770 Results File: /src/tests/GlyphEditor.Tests/TestResults/testresults.trx #22 6.770 #22 6.774 Failed! - Failed: 1, Passed: 20, Skipped: 0, Total: 21, Duration: 786 ms - GlyphEditor.Tests.dll (net7.0)
executor failed running [/bin/sh -c dotnet test "/src/tests/GlyphEditor.Tests/GlyphEditor.Tests.csproj" --logger "trx;LogFileName=testresults.trx"]: exit code: 1
Error when running deploy from azure.yaml
#22 [build 14/17] RUN dotnet test "/src/tests/GlyphEditor.Tests/GlyphEditor.Tests.csproj" --logger "trx;LogFileName=testresults.trx" #22 sha256:c7aef9e1bb3af1422a96faddb3f6968ad28dbe666fbabdd4396f20ecd74cb03a #22 0.791 Determining projects to restore... #22 1.573 All projects are up-to-date for restore. #22 3.452 GlyphEditor.Data.Abstractions -> /src/src/GlyphEditor.Data.Abstractions/bin/Debug/net7.0/GlyphEditor.Data.Abstractions.dll #22 3.861 GlyphEditor.Data.Postgres -> /src/src/GlyphEditor.Data.Postgres/bin/Debug/net7.0/GlyphEditor.Data.Postgres.dll #22 4.725 GlyphEditor.Api -> /src/src/GlyphEditor.Api/bin/Debug/net7.0/GlyphEditor.Api.dll #22 5.227 GlyphEditor.Integration.Tests -> /src/tests/GlyphEditor.Integration.Tests/bin/Debug/net7.0/GlyphEditor.Integration.Tests.dll #22 5.619 GlyphEditor.Tests -> /src/tests/GlyphEditor.Tests/bin/Debug/net7.0/GlyphEditor.Tests.dll #22 5.628 Test run for /src/tests/GlyphEditor.Tests/bin/Debug/net7.0/GlyphEditor.Tests.dll (.NETCoreApp,Version=v7.0) #22 5.729 Microsoft (R) Test Execution Command Line Tool Version 17.6.0 (x64) #22 5.729 Copyright (c) Microsoft Corporation. All rights reserved. #22 5.732 #22 5.791 Starting test execution, please wait... #22 5.817 A total of 1 test files matched the specified pattern. #22 7.058 Failed Should_upload_file_csv [62 ms] #22 7.058 Error Message: #22 7.058 Assert.Fail failed. failed #22 7.058 Stack Trace: #22 7.058 at GlyphEditor.Tests.Storage.AzureBlobStorageTests.Should_upload_file_csv() in /src/tests/GlyphEditor.Tests/Storage/AzureStorageTests.cs:line 36 #22 7.058 #22 7.146 Results File: /src/tests/GlyphEditor.Tests/TestResults/testresults.trx #22 7.146 #22 7.149 Failed! - Failed: 1, Passed: 20, Skipped: 0, Total: 21, Duration: 918 ms - GlyphEditor.Tests.dll (net7.0) #22 ERROR: executor failed running [/bin/sh -c dotnet test "/src/tests/GlyphEditor.Tests/GlyphEditor.Tests.csproj" --logger "trx;LogFileName=testresults.trx"]: exit code: 1
To Reproduce
add unit test to a docker file from an asp.net core 7.x project
example docker lines:
RUN dotnet restore "/src/tests/GlyphEditor.Tests/GlyphEditor.Tests.csproj"
COPY . .
RUN dotnet build "/src/tests/GlyphEditor.Tests/GlyphEditor.Tests.csproj" -c Release -o /app/build
RUN dotnet test "/src/tests/GlyphEditor.Tests/GlyphEditor.Tests.csproj" --logger "trx;LogFileName=testresults.trx"
Expected behavior
I expected to see the following both locally and on GitHub workflow:
ERROR [build 14/18] RUN dotnet test "/src/tests/GlyphEditor.Tests/GlyphEditor.Tests.csproj" --logger "trx;LogFileName=testresults.trx" 6.9s
[build 14/18] RUN dotnet test "/src/tests/GlyphEditor.Tests/GlyphEditor.Tests.csproj" --logger "trx;LogFileName=testresults.trx": #22 0.826 Determining projects to restore... #22 1.558 All projects are up-to-date for restore. #22 3.427 GlyphEditor.Data.Abstractions -> /src/src/GlyphEditor.Data.Abstractions/bin/Debug/net7.0/GlyphEditor.Data.Abstractions.dll #22 3.837 GlyphEditor.Data.Postgres -> /src/src/GlyphEditor.Data.Postgres/bin/Debug/net7.0/GlyphEditor.Data.Postgres.dll #22 4.671 GlyphEditor.Api -> /src/src/GlyphEditor.Api/bin/Debug/net7.0/GlyphEditor.Api.dll #22 5.114 GlyphEditor.Integration.Tests -> /src/tests/GlyphEditor.Integration.Tests/bin/Debug/net7.0/GlyphEditor.Integration.Tests.dll #22 5.376 GlyphEditor.Tests -> /src/tests/GlyphEditor.Tests/bin/Debug/net7.0/GlyphEditor.Tests.dll #22 5.384 Test run for /src/tests/GlyphEditor.Tests/bin/Debug/net7.0/GlyphEditor.Tests.dll (.NETCoreApp,Version=v7.0) #22 5.483 Microsoft (R) Test Execution Command Line Tool Version 17.6.0 (x64) #22 5.483 Copyright (c) Microsoft Corporation. All rights reserved. #22 5.487 #22 5.555 Starting test execution, please wait... #22 5.582 A total of 1 test files matched the specified pattern. #22 6.675 Failed Should_upload_file_csv [61 ms] #22 6.675 Error Message: #22 6.675 Assert.Fail failed. test failed #22 6.675 Stack Trace: #22 6.675 at GlyphEditor.Tests.Storage.AzureBlobStorageTests.Should_upload_file_csv() in /src/tests/GlyphEditor.Tests/Storage/AzureStorageTests.cs:line 36 #22 6.675 #22 6.770 Results File: /src/tests/GlyphEditor.Tests/TestResults/testresults.trx #22 6.770 #22 6.774 Failed! - Failed: 1, Passed: 20, Skipped: 0, Total: 21, Duration: 786 ms - GlyphEditor.Tests.dll (net7.0)
executor failed running [/bin/sh -c dotnet test "/src/tests/GlyphEditor.Tests/GlyphEditor.Tests.csproj" --logger "trx;LogFileName=testresults.trx"]: exit code: 1
Environment
Information on your environment:
*Microsoft Visual Studio Community 2022 (64-bit) - Current Version 17.6.1
*Asp.net core 7.x
Additional context
There is not error messages when deploying locally.
Github workflow shows the following:
ERROR: failed building service 'api': failing invoking action 'build', building container: api at .: building image: exit code: 1, stdout: , stderr: ERROR: failed to solve: executor failed running [/bin/sh -c dotnet test "/src/tests/GlyphEditor.Tests/GlyphEditor.Tests.csproj" --logger "console;verbosity=detailed"]: exit code: 1
Error: Process completed with exit code 1.
The text was updated successfully, but these errors were encountered:
Output from
azd version
azd version 1.0.0 (commit ed2244c)
Describe the bug
I have added unit testing in my Dockerfile. When I run the docker file locally, I see the test failing. However, I don't see it when it run it in GitHub workflows.
error I see when I run the Dockerfile locally
Error when running deploy from azure.yaml
#22 [build 14/17] RUN dotnet test "/src/tests/GlyphEditor.Tests/GlyphEditor.Tests.csproj" --logger "trx;LogFileName=testresults.trx"
#22 sha256:c7aef9e1bb3af1422a96faddb3f6968ad28dbe666fbabdd4396f20ecd74cb03a
#22 0.791 Determining projects to restore...
#22 1.573 All projects are up-to-date for restore.
#22 3.452 GlyphEditor.Data.Abstractions -> /src/src/GlyphEditor.Data.Abstractions/bin/Debug/net7.0/GlyphEditor.Data.Abstractions.dll
#22 3.861 GlyphEditor.Data.Postgres -> /src/src/GlyphEditor.Data.Postgres/bin/Debug/net7.0/GlyphEditor.Data.Postgres.dll
#22 4.725 GlyphEditor.Api -> /src/src/GlyphEditor.Api/bin/Debug/net7.0/GlyphEditor.Api.dll
#22 5.227 GlyphEditor.Integration.Tests -> /src/tests/GlyphEditor.Integration.Tests/bin/Debug/net7.0/GlyphEditor.Integration.Tests.dll
#22 5.619 GlyphEditor.Tests -> /src/tests/GlyphEditor.Tests/bin/Debug/net7.0/GlyphEditor.Tests.dll
#22 5.628 Test run for /src/tests/GlyphEditor.Tests/bin/Debug/net7.0/GlyphEditor.Tests.dll (.NETCoreApp,Version=v7.0)
#22 5.729 Microsoft (R) Test Execution Command Line Tool Version 17.6.0 (x64)
#22 5.729 Copyright (c) Microsoft Corporation. All rights reserved.
#22 5.732
#22 5.791 Starting test execution, please wait...
#22 5.817 A total of 1 test files matched the specified pattern.
#22 7.058 Failed Should_upload_file_csv [62 ms]
#22 7.058 Error Message:
#22 7.058 Assert.Fail failed. failed
#22 7.058 Stack Trace:
#22 7.058 at GlyphEditor.Tests.Storage.AzureBlobStorageTests.Should_upload_file_csv() in /src/tests/GlyphEditor.Tests/Storage/AzureStorageTests.cs:line 36
#22 7.058
#22 7.146 Results File: /src/tests/GlyphEditor.Tests/TestResults/testresults.trx
#22 7.146
#22 7.149 Failed! - Failed: 1, Passed: 20, Skipped: 0, Total: 21, Duration: 918 ms - GlyphEditor.Tests.dll (net7.0)
#22 ERROR: executor failed running [/bin/sh -c dotnet test "/src/tests/GlyphEditor.Tests/GlyphEditor.Tests.csproj" --logger "trx;LogFileName=testresults.trx"]: exit code: 1
To Reproduce
add unit test to a docker file from an asp.net core 7.x project
example docker lines:
RUN dotnet restore "/src/tests/GlyphEditor.Tests/GlyphEditor.Tests.csproj"
COPY . .
RUN dotnet build "/src/tests/GlyphEditor.Tests/GlyphEditor.Tests.csproj" -c Release -o /app/build
RUN dotnet test "/src/tests/GlyphEditor.Tests/GlyphEditor.Tests.csproj" --logger "trx;LogFileName=testresults.trx"
Expected behavior
I expected to see the following both locally and on GitHub workflow:
Environment
Information on your environment:
*Microsoft Visual Studio Community 2022 (64-bit) - Current Version 17.6.1
*Asp.net core 7.x
Additional context
There is not error messages when deploying locally.
Github workflow shows the following:
ERROR: failed building service 'api': failing invoking action 'build', building container: api at .: building image: exit code: 1, stdout: , stderr: ERROR: failed to solve: executor failed running [/bin/sh -c dotnet test "/src/tests/GlyphEditor.Tests/GlyphEditor.Tests.csproj" --logger "console;verbosity=detailed"]: exit code: 1
Error: Process completed with exit code 1.
The text was updated successfully, but these errors were encountered: