-
Notifications
You must be signed in to change notification settings - Fork 763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Load functions trying to find files in snippets test runner #3932
Comments
I think part of the problem is the missing EDIT: That explains the second error, not the first. |
One way you could solve the first problem is by adding a JSON file to the same
|
Now that I looked closer is that it should be done in this way. However I didn't test it if it works - I remember that I needed to do some work to get files to be copied to test directory for proper referencing. @rajyraman can you check if @anthony-c-martin suggestions work? |
My suggestion is taking advantage of the fact that bicep/src/Bicep.LangServer.IntegrationTests/Bicep.LangServer.IntegrationTests.csproj Line 29 in 1f7253b
The other potential option is to add a similar check to bicep/src/Bicep.LangServer.IntegrationTests/SnippetTemplatesTests.cs Lines 39 to 43 in 1f7253b
e.g. something like: if (prefix == "res-logic-app-file")
{
var requiredContents = @"{
""definition"": {}
}";
files.Add(new Uri("file:///REQUIRED"), requiredContents);
} |
@bhsubra do you have any other suggestions? |
In https://github.com/Azure/bicep/main/src/Bicep.Core.Samples/Bicep.Core.Samples.csproj#L13 I added that all files in assets subdir are included in output, perhaps something similar we could do for snippet integration tests. |
I tried below:
This won't work as it hits below code path and tries to load file from local path:
@miqm, I haven't tried option #1 suggested by @anthony-c-martin . Did that work for you? |
@anthony-c-martin - I tried your suggestion, but it did not work. Not sure why it is looking in root folder. |
@miqm - I am still getting this error even after rebasing. It is complaining about TEST_OUTPUT_DIR folder and not about root folder now. |
It's because test suite is looking for file called REQUIRED. We had discussion and snippet code should be compilable. You probably need to change the second 'REQUIRED' (the one not in comment) to logicApp.json Did you push your changes to repo so I could checkout? |
@miqm - I thought this is a simple fix, but I cannot get the tests working.
I am not sure what I am doing wrong.
Originally posted by @rajyraman in #3919 (comment)
The text was updated successfully, but these errors were encountered: