24 Test Plan for Function
Hanxiao Liu редактировал(а) эту страницу 2019-05-28 16:43:03 +08:00

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.
  • Can set server side java version to JDK1.8 when deploy
  • Can show server side java version information and reset the value if server side Java version is not set when deploy to an existing function app.

Please create function app with both old maven plugin(before 1.2.1) and new, and deploy to the two function apps again with new maven plugin. Plugin should prompt different info message in this test, for deploy to app created by new maven plugin, the message should be Java version of function host : ${Java Version}, for deploy to app created by old maven plugin, the message should be Java version of function host is not initiated, set it to Java 8.

Maven plugin will show warning message and reset the Java version when server side Java version doesn't meet the requirement of Azure Functions(Fow now function only support Java 8) , but now we can't set server side Java version in portal or maven plugin, will add new test later

The e2e experience is fine using the sample project

@CustomBinding Support

  • Make sure your local function-cli is the latest version

  • Clone the sample repo

  • Deploy to Cloud

    • Run mvn clean package azure-functions:deploy
  • Verify

    • Open the Function App in portal
    • Add a new application setting: AzureSignalRConnectionString: <your_connection_string>
    • In the platform features, go to CORS, remove all the entries, and add a new entry: *
    • Navigate to sub folder: samples/simple-chat/content/
    • Open index.html in browser
    • Enter your function app url as the base url, 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