Skip to content

Commit 1ccde34

Browse files
TEST Add partner-integration-tests yml (#1543)
1 parent 87978a9 commit 1ccde34

6 files changed

Lines changed: 84 additions & 143 deletions

File tree

.azuredevops/end-to-end-tests.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Runs end-to-end scenario tests using pyrit_scan CLI
2+
3+
trigger: none # Disable automatic CI triggers
4+
5+
schedules:
6+
- cron: "0 7 * * *" # 7 AM UTC = 11 PM PST (UTC-8) / Midnight PDT (UTC-7)
7+
displayName: Nightly E2E Tests at 11 PM PST
8+
branches:
9+
include:
10+
- main
11+
always: true # Run even if there are no code changes
12+
13+
jobs:
14+
- template: test-job-template.yml
15+
parameters:
16+
jobName: EndToEndTests
17+
jobDisplayName: "Run end-to-end scenario tests"
18+
testAzureSubscription: 'integration-test-service-connection'
19+
newDir: e2e_test_directory
20+
testsFolder: end_to_end
21+
makeTarget: end-to-end-test

.azuredevops/integration-tests.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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.
10+
11+
jobs:
12+
- template: test-job-template.yml
13+
parameters:
14+
jobName: IntegrationTests
15+
jobDisplayName: "Builds the pyrit environment and runs integration tests"
16+
testAzureSubscription: 'integration-test-service-connection'
17+
newDir: integration_test_directory
18+
testsFolder: integration
19+
makeTarget: integration-test
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Builds the pyrit environment and runs partner integration tests. Partner integration tests are to ensure that we
2+
# are not breaking any contract between PyRIT and its partners.
3+
trigger: none # Disable automatic CI triggers
4+
5+
schedules:
6+
- cron: "0 6 * * *" # 6 AM UTC = 10 PM PST (UTC-8) / 11PM PDT (UTC-6)
7+
displayName: Nightly Partner Integration Tests at 10 PM PST
8+
branches:
9+
include:
10+
- main
11+
always: true # Run even if there are no code changes
12+
13+
jobs:
14+
- template: test-job-template.yml
15+
parameters:
16+
jobName: PartnerIntegrationTests
17+
jobDisplayName: "Builds the pyrit environment and runs partner integration tests"
18+
testAzureSubscription: 'partner-integration-test-service-connection'
19+
newDir: partner_integration_test_directory
20+
testsFolder: partner_integration
21+
makeTarget: partner-integration-test
Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
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

1115
jobs:
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

end-to-end-tests.yml

Lines changed: 0 additions & 124 deletions
This file was deleted.

0 commit comments

Comments
 (0)