Pairing Continuous Integration (CI) with functional tests is one of the best ways to improve your build process and catch code errors early. With Functionize, you can:
- Deploy new code to a testing environment.
- Automatically trigger an orchestration of regression tests.
- Fail the build immediately if tests fail.
- Quickly diagnose and fix issues before retrying the build.
This ensures every committed change is tested, allowing you to release features with greater confidence.
How to Integrate Functionize with Jenkins
Step 1: Create a New Jenkins Project
- Open your Jenkins Dashboard.
- Select New Item.
- Enter a project name.
- Choose Freestyle project and click OK.
Step 2: Add the Build Step
- Go to the General tab of your project.
- Scroll down to the Build section.
- From the Add build step menu, select Execute Shell.
- In the command box, enter the following (replace values in {} with your details):
- Note: The YAML file contents must match the exact field names (clientId, clientSecret) from Functionize’s API key management page. Mislabeling fields causes token generation to fail.
- Note: You can find the Orchestration Deployment ID in your Functionize Orchestrations page under the Deployment tab.
touch {your YAML config file name}
rm {your YAML config file name}
echo "clientId: {your Client ID} \nclientSecret: {your Client Secret}" >> {your YAML file name}
# Generate an authentication token
fze token generate --config {your YAML file name}
# Run your orchestration and output results in JUnit format
fze orchestration run --wait --output junit --location . --id {Orchestration deployment ID} --config {your YAML file name}Step 3: Configure Post-Build Actions
- Scroll down to the Post-build Actions section.
- Select Publish JUnit test result report.
- Enter the file name for the result report (e.g.,
result.junit). - Click Save.
Step 4: Run and View Results
- In the Jenkins project window, select Build Now from the left sidebar.
- Once the build runs, click the build number (e.g., #1) in the sidebar.
- View the Console Output to see execution details.
- Test results will also appear in the Orchestrations page of the Functionize UI.
Key Benefits
- Early Detection of Errors: Build fails immediately if tests fail.
- Automation at Scale: Every commit runs regression tests automatically.
- Confidence in Releases: Validated builds lead to faster, safer deployments.
- Seamless Integration: Works with Jenkins or any pipeline tool.
Tip: You can extend this integration with other CI/CD tools beyond Jenkins (e.g., GitHub Actions, GitLab CI, Bamboo). The same fze CLI commands apply. You can also configure Jenkins to send alerts when Functionize orchestrations fail during CI testing.