Skip to content

Test Plan for Function

Sheng Chen edited this page Feb 26, 2019 · 24 revisions

Prerequisites:

End Game

<pluginRepositories>
    <pluginRepository>
        <id>commicrosoftazure-{id}</id>
        <name>commicrosoftazure-{id}</name>
        <url>https://oss.sonatype.org/content/repositories/commicrosoftazure-{id}/</url>
    </pluginRepository>
</pluginRepositories>

Regression Test

    <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.

azure-functions:package

  • Can generate the function files including jar and function.json for each function

azure-functions:add

  • 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) .

azure-functions:run

  • 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

azure-functions:deploy

  • 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

@CustomBinding Support

  • 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
  • Clone the sample repo

  • Setup project

    • Navigate to sub folder: samples/simple-chat/java
    • Copy local.settings.sample.json and rename to local.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
  • 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, click OK
    • 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
Clone this wiki locally