-
Notifications
You must be signed in to change notification settings - Fork 150
Test Plan for Function
Sheng Chen edited this page Feb 26, 2019
·
24 revisions
- Generate a Azure Functions archetype
- Add following in pom.xml to get the latest azure-function-maven plugin
<pluginRepositories>
<pluginRepository>
<id>commicrosoftazure-{id}</id>
<name>commicrosoftazure-{id}</name>
<url>https://oss.sonatype.org/content/repositories/commicrosoftazure-{id}/</url>
</pluginRepository>
</pluginRepositories>
- Generate a Azure Functions archetype
- Add following in pom.xml to get the latest azure-function-maven plugin
<pluginRepositories>
<pluginRepository>
<id>maven.snapshots</id>
<name>Maven Central Snapshot Repository</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
Regression test will use SNAPSHOT version, please set
<azure.functions.maven.plugin.version>TestVersion-SNAPSHOT</azure.functions.maven.plugin.version> in pom.
- Can generate the function files including jar and function.json for each function
- Can add HTTP Trigger function
- Can add Blob Trigger function
- Can add Queue Trigger function
- Can add Timer Trigger function
- Can add Event Grid Trigger function
- Can add Event Hub Trigger function
- Can add Cosmos DB Trigger function
- Can add Service Bus Queue Trigger function
- Can add Service Bus Topic Trigger function
- Plugin will show prompt information and default value(for some attributes) when set function attribute, and valid the value(for some attributes) .
- Can run function host locally.
- Can run function host locally in debug mode.
- Debug arguments like port and suspend could be customized, refer here for more infos.
- Attach to function host and verify debugger could work well
- Can deploy in the Azure Cloud Shell
- Generate a function project in the Cloud Shell
- Update the plugin version to the one we want to test with
- Can deploy when deploymentType is set to:
-
zip
(this is the default type) msdeploy
ftp
-
- Can update application settings through the
<appSettings>
configuration - Can create a function app if the name of the function app not exist on Azure, the properties of the created function app should be same as the configuration in the pom. More details here
- Can deploy to an existing App Service Plan
- Applications with upper cases in appname should be deployed successfully as well.
- After deployment, the function should be triggerred successfully.
The e2e experience is fine using the sample project
-
Update Java worker
- Pull latest code in
develop
branch from https://github.com/Azure/azure-functions-java-worker - Run mvnBuildSkipTests.bat
- Copy azure-functions-java-worker--SNAPSHOT.jar package under target folder to replace %UserProfile%\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\java, remove version suffix and make name as azure-functions-java-worker.jar
- Pull latest code in
-
Clone the sample repo
- https://github.com/JialinXin/azure-functions-signalrservice-extension/tree/javasample
- Make sure you are using branch:
javasample
-
Setup project
- Navigate to sub folder:
samples/simple-chat/java
- Copy
local.settings.sample.json
and rename tolocal.settings.json
:- Update
AzureSignalRConnectionString
with keys from azure portal - Update
CORS
with value "*" in order to visit from local - Run
mvn clean package azure-functions:run
- Update
- Navigate to sub folder:
-
Verify
- Navigate to sub folder:
samples/simple-chat/content/
- Open
index.html
in browser - Keep the base url as
http://localhost:7071
which is the function running, clickOK
- Input any value for username, click OK
- Verify no exception pop up, or verify F12 that all requests are good
- Type some message and send, verify it shows up in the page
- Navigate to sub folder:
- Home
- Authentication
- Proxy
- Common Configurations
-
Maven Plugin for Azure Web Apps
- Quickstarts
- Goals
- Configuration Details
- Samples
-
Maven Plugin for Azure Functions
- Quickstarts
- Archetype
- Goals
- Configuration Details
-
Maven Plugin for Azure Spring Apps
- Quickstarts
- Goals
- Configuration Details
- Maven Plugin for Azure Container Apps
- Using in CI/CD