1-
2- # Builds the pyrit environment and runs integration tests
3-
4- trigger :
5- branches :
6- include :
7- - main
8-
9- # There are additional PR triggers for this that are configurable in ADO.
1+ parameters :
2+ - name : jobName
3+ type : string
4+ - name : jobDisplayName
5+ type : string
6+ - name : testAzureSubscription
7+ type : string
8+ - name : newDir
9+ type : string
10+ - name : testsFolder
11+ type : string
12+ - name : makeTarget
13+ type : string
1014
1115jobs :
12- - job : IntegrationTests
13- displayName : " Builds the pyrit environment and runs integration tests "
14- timeoutInMinutes : 360 # Allows the job to run up to 6 hours
16+ - job : ${{ parameters.jobName }}
17+ displayName : ${{ parameters.jobDisplayName }}
18+ timeoutInMinutes : 360
1519 pool :
1620 vmImage : ubuntu-latest
1721 steps :
@@ -79,21 +83,21 @@ jobs:
7983 name : install_PyRIT
8084 - bash : df -all -h
8185 name : disk_space_check
82- # This step ensures that integration tests are run outside of the PyRIT repository to test that .env files are accessed correctly.
86+ # This step ensures that tests are run outside of the PyRIT repository to test that .env files are accessed correctly.
8387 - bash : |
8488 PyRIT_DIR=$(pwd)
85- NEW_DIR="integration_test_directory "
89+ NEW_DIR="${{ parameters.newDir }} "
8690 cd ..
8791 mkdir -p $NEW_DIR/tests
8892 cp -r $PyRIT_DIR/doc $NEW_DIR
8993 cp -r $PyRIT_DIR/assets $NEW_DIR
90- cp -r $PyRIT_DIR/tests/integration $NEW_DIR/tests
94+ cp -r $PyRIT_DIR/tests/${{ parameters.testsFolder }} $NEW_DIR/tests
9195 cd $NEW_DIR
92- displayName: "Create and switch to new integration test directory"
96+ displayName: "Create and switch to new test directory"
9397 - task : AzureCLI@2
9498 displayName : " Authenticate with service principal, cache Cognitive Services access token, and run tests"
9599 inputs :
96- azureSubscription : ' integration-test-service-connection '
100+ azureSubscription : ${{ parameters.testAzureSubscription }}
97101 scriptType : ' bash'
98102 scriptLocation : ' inlineScript'
99103 inlineScript : |
@@ -109,8 +113,8 @@ jobs:
109113 az account get-access-token --scope https://database.windows.net/.default --output none
110114 echo "Azure SQL Database access token cached successfully."
111115
112- # Run integration tests
113- make integration-test
116+ # Run tests
117+ make ${{ parameters.makeTarget }}
114118 - bash : |
115119 rm -f ~/.pyrit/.env ~/.pyrit/.env.local
116120 name: clean_up_env_files
0 commit comments