Closed mirkoSekulic closed 1 year ago
Hello @mirkoSekulic, Since your project looks quite difficult we aren't sure that we have sufficient knowledge for proper debugging. Could you please provide the exact minimal repro steps?
@Alexey-Ayupov I'll try at least. It's really strange behavior. Here are the steps how you can reproduce the issue:
Reference root testData folder as embedded resource in csproj file. Something like:
<ItemGroup>
<EmbeddedResource Include="..\..\..\testdata\Model\**\*.*">
<LinkBase>TestData\Model</LinkBase>
</EmbeddedResource>
</ItemGroup>
<Your-assembly> .GetManifestResourceNames()
You'll see that files with name ending with ".metadata.json" are not listed. But when removing "metadata" part from the file names, for example renaming to "xxx.json", they are listed.
@Alexey-Ayupov here is the minimal repo with reproduced issue. You can check latest failed pipeline. Project have 2 embedded files with the same content. One file have extension ".json" and another ".metadata.json". You'll see that in the test only ".json" file is listed as a resource.
@marko-zivic-93 @dmitry-shibanov transferring to you as to most relevant maintainers as setup-dotnet is used. If you need any help from us just let me know
Hi, @mirkoSekulic 👋 Sorry for the late response, we started to investigate the issue. As soon as we have any information, we will get back with it to you.
Hello, @mirkoSekulic ! I just wanted to give you a gentle ping to see if you've come across the same issue again? If so, could you please share a more recent workflow run, as the one provided has expired in the meantime. I will take a closer look into it and see how I can help.
Thank you for your cooperation and I apologize for the late response :)
Hi, @mirkoSekulic 👋 I tried to reproduce the issue on my local machine (macOS) with .NET 7.0 preinstalled. As the result, I got the same error. It seems like files with metadata.json
extension are interpreted by EmbeddedResource item group in a specific manner. So basically cause of the problem is in the peculiarities of the .NET behavior and it's not a problem of GitHub hosted runners or the setup-dotnet itself. Unfortunately, I can't help you to solve this problem, as I don't have broad experience with .NET.
Now, I'm going to close this issue, If you have any additional questions feel free to ping me.
Description
Seems like there is a bug in the github "ubuntu:latest" actions runners. Files with extension ".metadata.json" are not present when running scripts and therefore dotnet tests are failing.
Our repo had test files that had extension ".metadata.json". Pipeline failed with exception message that files doesn't exists.
Removing "metadata" from test file names fixed the issue. That renaming workaround was implemented in this pr.
Platforms affected
Runner images affected
Image version and build link
Ubuntu:latest
Here is the link to failed pipeline: https://github.com/Altinn/altinn-studio/actions/runs/4016169742/jobs/6898823480Here is the link to failed pipeline: https://github.com/mirkoSekulic/runner-fail-test/actions/runs/4311965692
Is it regression?
No
Expected behavior
Files should be accessible by test scripts.
Actual behavior
Files are removed from repo when running scripts and not accessible from the tests
Repro steps
~~1. Go to altinn-studio repo
Create a new branch from this commit
Remove Skip="ubuntu-fail" from tests in DataModeling.Tests.JsonMetadataParserTests class and in DataModeling.Tests.JsonSchemaToMetamodelConverterTests . Tests are located in backend folder
Run the pipelines~~
Go to this repo
Create a dummy pr to run the pipeline, or check the logs of the latest failed pipeline
Workarund with renaming files is done in following pr: Altinn/altinn-studio#9673