Awesome
Azure Functions Node.js E2E Tests
This repo contains end-to-end tests for Node.js on Azure Functions. These are automated tests designed to run regularly against prerelease versions of all the various pieces that make up the Node.js experience on Azure Functions, including:
Pipeline
Here is the general flow of the pipeline:
- Install node modules and build both the tests themselves and the test apps
- Create several resources in Azure that will be used for testing different bindings. A unique resource prefix is generated for each individual build so that builds aren't sharing resources
- Run the tests. A few notes:
- These are run in parallel by OS, but in serial by Node.js version and programming model version. Theoretically every combination could be run in parallel, but that would use a ton of Azure Pipelines agents and create a lot of Azure resources for minimal gain in time.
- The primary method of validation is to run core tools against the test app and validate the output
- Delete the Azure resources
- Upload test results
Running locally
Install core tools
- Run
./scripts/install-func-cli.ps1
in PowerShell to install the latest nightly build of Azure Functions Core Tools
Build
- Run
npm run install
andnpm run build
in the root directory, and in the test app folders (app/v3
andapp/v4
)
Create resources
You need to create resources once in your subscription, but then you can reuse the same resources for many different test runs. The CI pipeline will create and delete resources each time, but you don't need to do that.
- Set the environment variable
BUILD_BUILDNUMBER
to any number like20230520.1
. You want it to be reasonably unique because this will be used as a prefix for your Azure resources. - Run
az login
andaz account set -s <subscription id>
if you're not already logged in to the Azure CLI. The tests will use these credentials. - Run
npm run createResources
- Validate the resources were created. You should see a resource group in your subscription like
e2edarwin202305201group
with several resources
Run tests
- Run
npm run testV3
to test the v3 app,npm run testV4
to test the v4 app, ornpm run test
to test both
Code of Conduct
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.