-
Notifications
You must be signed in to change notification settings - Fork 64
Creates PowerShell Samples / Tests #449
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
Conversation
AddProductWithIdentity seems to be failing at random as it passes in some of the ad-hoc builds but then a different I will be marking all of them as unstable for now, and track here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Make sure you merge in latest from main to remove the serialization changes
- If you haven't been able to verify that it's using the locally built extension DLL during tests (both locally and in the pipeline) then what would probably be best is to remove Powershell from the list of supported languages and then follow up with a PR that actually enables the tests (along with any changes necessary to run using the locally built DLL). This will make that simpler to review and get this in so that others can at least see the various samples and use them while giving you time to figure out the test situation so we're actually testing latest changes to the code
Also it would be good to add a .vscode folder with the recommended extensions for these samples (AF and Powershell extensions at least, not sure if there's any more that you've found helpful) as well as other things like launch targets. The goal should be that someone can open VS Code to the samples-powershell folder and directly run the samples from there using F5 and be able to debug their function. See https://github.com/Azure/azure-functions-sql-extension/pull/458/files#diff-5901d1ff3dfb2f6d0846ab6a4aeab48d916c3a07b3074de578cb760e3be9bb50R3 for an example, you can create a new Powershell function project to get the default stuff from there and then modify it if needed for the samples. |
test/Integration/test-powershell/AddProductsNoPartialUpsert/run.ps1
Outdated
Show resolved
Hide resolved
test/Integration/test-powershell/AddProductsNoPartialUpsert/run.ps1
Outdated
Show resolved
Hide resolved
How about including extension recommendations for the PS + Azure functions extensions? |
@Charles-Gagnon, after discussion with @lucyzhang929 we found that the local and pipeline are using the latest preview extension bundle. Here are links to the latest pipeline runs that indicate we are using the correct latest version (4.3.1) of the Preview Extension bundle: Lucy and I discussed steps locally that could be documented further to test locally built DLL:
|
It's not the latest version of the bundle I'm worried about, it's the version of the extension DLL that is being loaded by the functions during tests. It doesn't help a lot to be using the one from the bundle since the tests should be verify that the code in the repo at the commit the test is running against still works as expected.
|
@chlafreniere Pushed latest commit to include recommendations for PS and Az Func. |
Based on the logging from Azure Functions in the pipeline run Vasu linked above, it is loading the extension bundle from the same folder we copy the sql dll into. Although to be 100% sure, maybe we can add some temporary logging and ensure that the logs are being printed in the pipeline. Automatically copying over the latest dll to our local extension bundle would be great. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good, but you have some test failures now. Please make sure those are addressed before merging in.
samples/samples-powershell/AddProductWithDefaultPK/function.json
Outdated
Show resolved
Hide resolved
samples/samples-powershell/AddProductWithIdentityColumn/run.ps1
Outdated
Show resolved
Hide resolved
samples/samples-powershell/AddProductWithIdentityColumnIncluded/run.ps1
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few other samples that have incorrect comments.
# Write to the Azure Functions log stream. | ||
Write-Host "PowerShell function with SQL Output Binding processed a request." | ||
|
||
# Update req_query with the body of the request |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update comment
# Write to the Azure Functions log stream. | ||
Write-Host "PowerShell function with SQL Output Binding processed a request." | ||
|
||
# Update req_query with the body of the request |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update comment
# Write to the Azure Functions log stream. | ||
Write-Host "PowerShell function with SQL Output Binding processed a request." | ||
|
||
# Update req_body with the body of the request |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update comment
# Write to the Azure Functions log stream. | ||
Write-Host "PowerShell function with SQL Output Binding processed a request." | ||
|
||
# Update req_body with the body of the request |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update comment
# Write to the Azure Functions log stream. | ||
Write-Host "PowerShell function with SQL Output Binding processed a request." | ||
|
||
# Update req_body with the body of the request |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update comment
# Write to the Azure Functions log stream. | ||
Write-Host "PowerShell function with SQL Output Binding processed a request." | ||
|
||
# Update req_body with the body of the request |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update comment
# Write to the Azure Functions log stream. | ||
Write-Host "PowerShell function with SQL Output Binding processed a request." | ||
|
||
# Update req_body with the body of the request |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update comment
Creates PowerShell Samples / Tests
Created the samples and tests following C# / Javascript samples.
The PowerShell integration issues will be tracked here:
#448
Had to update the local.settings.json in order to pass the ad hoc build.
Other known issues found while developing:
If a test fails, the function host won't start as the port is unavailable and therefore needs to kill the port to continue some of the tests. (Plan to create a fix in another PR).
PowerShell worker issue: #443