This is step-by-step guide for setting up an Azure DevOps pipeline to automate the synchronization of feature files from AssertThat Test Management to an existing Azure DevOps repository.
...
Code Block |
---|
pool: vmImage: 'ubuntu-latest' steps: - script: | # Download the feature files from AssertThat # Extract the zip contents # Set up Git with your Azure DevOps repository credentials # Assuming you've already prepared the feature files locally # Replace the following placeholders with actual values: # - YOUR_JIRA_HOST (ASSERT_THAT API endpoint, typically the Jira host) # - YOUR_ASSERTTHAT_ACCESS_KEY (access key from AssertThat project configuration) # - YOUR_ASSERTTHAT_SECRET_KEY (secret key from AssertThat project configuration) # - YOUR_AZURE_DEVOPS_REPO_URL # - YOUR_AZURE_DEVOPS_USERNAME # - YOUR_AZURE_DEVOPS_TOKEN # - YOUR_ASSERT_THAT_PROJECT_ID (the ID of your project in AssertThat) # Export feature files from ASSERT_THAT (use ASSERT_THAT REST API with access and secret keys) curl -o feature_files.zip -H "Authorization: Basic $(echo -n YOUR_ASSERTTHAT_ACCESS_KEY:YOUR_ASSERTTHAT_SECRET_KEY | base64)" https://YOUR_JIRA_HOST/rest/assertthat/latest/project/YOUR_ASSERT_THAT_PROJECT_ID/client/features # NOTE: The example above is for Jira Data Center. In case you use cloud version the following URL should be used for downloading features:https://bdd.assertthat.app/rest/api/1/project/YOUR_ASSERT_THAT_PROJECT_ID/features # Unzip the feature files unzip feature_files.zip # Set up Git git config --global user.email "you@example.com" git config --global user.name "Your Name" git clone https://YOUR_AZURE_DEVOPS_USERNAME:YOUR_AZURE_DEVOPS_TOKEN@YOUR_AZURE_DEVOPS_REPO_URL git add *.feature git commit -m "Sync feature files from AssertThat" git push origin main displayName: 'Export and Push Feature Files' # Additional steps can be added for testing and reporting as needed |
Replace the placeholders with your specific Jira host, AssertThat access key, AssertThat secret key, Azure DevOps repository details, and credentials.
The
curl
command is used to download the feature files from AssertThat using the access and secret keys.The
Authorization: Basic
header is used with base64-encoded access and secret keys.The script unzips the downloaded feature files, sets up a Git repository, and pushes the files to the Azure DevOps repository. NOTE: The example above is for Jira Data Center. In case you use cloud version the following URL should be used for downloading features:
https://bdd.assertthat.app/rest/api/1/project/YOUR_ASSERT_THAT_PROJECT_ID/features
Step 3: Save and Run the Pipeline
...