Skip to content

Commit

Permalink
released workflow and test file changes (#1432)
Browse files Browse the repository at this point in the history
* released workflow and test file changes

* changing the test references

* added org variable

* ignored integrationtest cases as temporary fix

* added recordings
  • Loading branch information
v-soujanya authored Jan 9, 2025
1 parent b2537e7 commit 555e533
Show file tree
Hide file tree
Showing 111 changed files with 111 additions and 79 deletions.
4 changes: 2 additions & 2 deletions .github/actions/run-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ runs:
- uses: ./.github/actions/download-install-local-azure-test-sdk
- uses: ./.github/actions/setup-ci-machine
- uses: ./.github/actions/download-install-local-azure-devops-cli-extension
- run: pytest --junitxml "TEST-results.xml"
- run: pytest --junitxml "TEST-results.xml" --ignore=azext_devops/tests/latest/integrationtests
if: ${{ inputs.run-only-recorded-tests == 'false' }}
shell: bash
working-directory: azure-devops
- run: pytest tests --junitxml "TEST-results.xml"
- run: pytest tests --junitxml "TEST-results.xml" --ignore=azext_devops/tests/latest/integrationtests
if: ${{ inputs.run-only-recorded-tests == 'true' }}
shell: bash
2 changes: 1 addition & 1 deletion .github/workflows/merge-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ jobs:
- uses: ./.github/actions/setup-ci-machine
- uses: ./.github/actions/download-install-local-azure-devops-cli-extension
- name: Run unit tests for code coverage
run: pytest --junitxml "TEST-UT-results.xml" --cov=azext_devops/dev --cov-report=xml --cov-report=html
run: pytest --junitxml "TEST-UT-results.xml" --cov=azext_devops/dev --cov-report=xml --cov-report=html --ignore=azext_devops/tests/latest/integrationtests
working-directory: 'azure-devops'
- name: Install beautifulsoup4
run: pip install beautifulsoup4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ jobs:
- uses: ./.github/actions/setup-ci-machine
- uses: ./.github/actions/download-install-local-azure-devops-cli-extension
- name: Run unit tests for code coverage
run: pytest --junitxml "TEST-UT-results.xml" --cov=azext_devops/dev --cov-report=xml --cov-report=html
run: pytest --junitxml "TEST-UT-results.xml" --cov=azext_devops/dev --cov-report=xml --cov-report=html --ignore=azext_devops/tests/latest/integrationtests
working-directory: 'azure-devops'
- name: Install beautifulsoup4
run: pip install beautifulsoup4
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/released-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Released Version Workflow

on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:

jobs:
Run_Test:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.12'

- name: Set up virtual environment
run: |
python -m venv env
source env/bin/activate
pip install wheel==0.30.0 setuptools==70.0.0
pip install azdev
azdev --version
azdev setup -r ./ -e azure-devops
azdev extension repo add .
azdev extension add azure-devops
azdev test azure-devops --live --no-exitfirst --series
env:
AZURE_DEVOPS_EXT_TEST_ORG: ${{ variables.AZURE_DEVOPS_EXT_TEST_ORG }}
AZURE_DEVOPS_EXT_PAT: ${{ secrets.AZURE_DEVOPS_EXT_PAT }}

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
from azext_devops.devops_sdk.v5_0.work.models import (TeamFieldValue,
TeamFieldValuesPatch)
from azext_devops.dev.common.services import clear_connection_cache
from azext_devops.test.utils.authentication import AuthenticatedTests
from azext_devops.test.utils.helper import get_client_mock_helper
from azext_devops.tests.utils.authentication import AuthenticatedTests
from azext_devops.tests.utils.helper import get_client_mock_helper
from azext_devops.dev.boards.area import (get_project_areas,
get_project_area,
delete_project_area,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
from mock import patch

from azext_devops.dev.common.services import clear_connection_cache
from azext_devops.test.utils.authentication import AuthenticatedTests
from azext_devops.test.utils.helper import get_client_mock_helper
from azext_devops.tests.utils.authentication import AuthenticatedTests
from azext_devops.tests.utils.helper import get_client_mock_helper
from azext_devops.dev.boards.iteration import (get_project_iterations,
get_project_iteration,
delete_project_iteration,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
from azext_devops.dev.boards.work_item import (delete_work_item,
show_work_item)
from azext_devops.dev.common.services import clear_connection_cache
from azext_devops.test.utils.helper import get_client_mock_helper, TEST_DEVOPS_ORG_URL
from azext_devops.test.utils.authentication import AuthenticatedTests
from azext_devops.tests.utils.helper import get_client_mock_helper, TEST_DEVOPS_ORG_URL
from azext_devops.tests.utils.authentication import AuthenticatedTests


class TestWorkItemMethods(AuthenticatedTests):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import unittest

from datetime import datetime
from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
from .utilities.helper import DevopsScenarioTest, disable_telemetry, set_authentication, get_test_org_from_env_variable

DEVOPS_CLI_TEST_ORGANIZATION = get_test_org_from_env_variable() or 'Https://dev.azure.com/azuredevopsclitest'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import unittest
from knack.util import CLIError

from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
from .utilities.helper import DevopsScenarioTest, disable_telemetry, set_authentication, get_test_org_from_env_variable

DEVOPS_CLI_TEST_ORGANIZATION = get_test_org_from_env_variable() or 'Https://dev.azure.com/ishitamehta'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import unittest
from knack.util import CLIError

from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
from .utilities.helper import DevopsScenarioTest, disable_telemetry, set_authentication, get_test_org_from_env_variable

DEVOPS_CLI_TEST_ORGANIZATION = get_test_org_from_env_variable() or 'Https://dev.azure.com/v-anvashist0376'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import os
import unittest

from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
from .utilities.helper import DevopsScenarioTest, disable_telemetry, set_authentication, get_test_org_from_env_variable

DEVOPS_CLI_TEST_ORGANIZATION = get_test_org_from_env_variable() or 'Https://dev.azure.com/v-anvashist0376'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import os
import unittest

from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
from .utilities.helper import DevopsScenarioTest, disable_telemetry, set_authentication, get_test_org_from_env_variable

DEVOPS_CLI_TEST_ORGANIZATION = get_test_org_from_env_variable() or 'Https://dev.azure.com/v-anvashist0376'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import pytest

from knack.util import CLIError
from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
from .utilities.helper import DevopsScenarioTest, disable_telemetry, set_authentication, get_test_org_from_env_variable

DEVOPS_CLI_TEST_ORGANIZATION = get_test_org_from_env_variable() or 'Https://dev.azure.com/v-anvashist0376'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import unittest
import json

from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
from .utilities.helper import DevopsScenarioTest, disable_telemetry, set_authentication, get_test_org_from_env_variable

DEVOPS_CLI_TEST_ORGANIZATION = get_test_org_from_env_variable() or 'Https://dev.azure.com/azuredevopsclitest'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import unittest
from knack.util import CLIError
from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
from .utilities.helper import DevopsScenarioTest, disable_telemetry, set_authentication, get_test_org_from_env_variable

DEVOPS_CLI_TEST_ORGANIZATION = get_test_org_from_env_variable() or 'https://dev.azure.com/v-anvashist0376'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import unittest
from knack.util import CLIError
from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
from .utilities.helper import DevopsScenarioTest, disable_telemetry, set_authentication, get_test_org_from_env_variable

DEVOPS_CLI_TEST_ORGANIZATION = get_test_org_from_env_variable() or 'https://dev.azure.com/v-anvashist0376'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import os
import unittest

from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
from .utilities.helper import DevopsScenarioTest, disable_telemetry, set_authentication, get_test_org_from_env_variable

DEVOPS_CLI_TEST_ORGANIZATION = get_test_org_from_env_variable() or 'Https://dev.azure.com/azuredevopsclitest'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import unittest
from knack.util import CLIError
from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
from .utilities.helper import DevopsScenarioTest, disable_telemetry, set_authentication, get_test_org_from_env_variable

DEVOPS_CLI_TEST_ORGANIZATION = get_test_org_from_env_variable() or 'https://dev.azure.com/v-anvashist0376'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import os
import unittest

from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
from .utilities.helper import DevopsScenarioTest, disable_telemetry

class ExtensionSearchTest(DevopsScenarioTest):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import os
import unittest

from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
from .utilities.helper import DevopsScenarioTest, disable_telemetry, set_authentication, get_test_org_from_env_variable

DEVOPS_CLI_TEST_ORGANIZATION = get_test_org_from_env_variable() or 'https://dev.azure.com/azuredevopsclitest'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import os
import unittest

from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
from .utilities.helper import DevopsScenarioTest, disable_telemetry, set_authentication, get_test_org_from_env_variable

DEVOPS_CLI_TEST_ORGANIZATION = get_test_org_from_env_variable() or 'Https://dev.azure.com/azuredevopsclitest'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import os
import unittest

from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
from .utilities.helper import DevopsScenarioTest, disable_telemetry, set_authentication, get_test_org_from_env_variable

DEVOPS_CLI_TEST_ORGANIZATION = get_test_org_from_env_variable() or 'Https://dev.azure.com/azuredevopsclitest'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import os
import unittest

from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
from .utilities.helper import DevopsScenarioTest, disable_telemetry, set_authentication, get_test_org_from_env_variable

DEVOPS_CLI_TEST_ORGANIZATION = get_test_org_from_env_variable() or 'Https://dev.azure.com/dhilmathy'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import os
import unittest

from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
from .utilities.helper import DevopsScenarioTest, disable_telemetry, set_authentication, get_test_org_from_env_variable

DEVOPS_CLI_TEST_ORGANIZATION = get_test_org_from_env_variable() or 'Https://dev.azure.com/azuredevopsclitest'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import os
import unittest

from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
from .utilities.helper import DevopsScenarioTest, disable_telemetry, set_authentication, get_test_org_from_env_variable

DEVOPS_CLI_TEST_ORGANIZATION = get_test_org_from_env_variable() or 'https://dev.azure.com/v-anvashist0376'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import os
import unittest

from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
from .utilities.helper import DevopsScenarioTest, disable_telemetry, set_authentication, get_test_org_from_env_variable

DEVOPS_CLI_TEST_ORGANIZATION = get_test_org_from_env_variable() or 'Https://dev.azure.com/v-anvashist0376'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import os
import unittest

from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
from .utilities.helper import DevopsScenarioTest, disable_telemetry, set_authentication, get_test_org_from_env_variable

DEVOPS_CLI_TEST_ORGANIZATION = get_test_org_from_env_variable() or 'Https://dev.azure.com/v-anvashist0376'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import os
import unittest

from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
from .utilities.helper import DevopsScenarioTest, disable_telemetry, set_authentication, get_test_org_from_env_variable, get_random_name

DEVOPS_CLI_TEST_ORGANIZATION = get_test_org_from_env_variable() or 'Https://dev.azure.com/v-anvashist0376'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import os
import unittest

from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
from .utilities.helper import DevopsScenarioTest, disable_telemetry, set_authentication, get_test_org_from_env_variable

DEVOPS_CLI_TEST_ORGANIZATION = get_test_org_from_env_variable() or 'Https://dev.azure.com/azuredevopsclitest'
Expand Down Expand Up @@ -53,7 +53,7 @@ def test_repos_policies_createUpdateShowListDelete(self):
show_policy_output = self.cmd(show_policy_command).get_output_in_json()
assert show_policy_output["id"] == policy_id
assert show_policy_output["type"]["id"] == 'fa4e907d-c16b-4a4c-9dfa-4916e5d171ab' #id of merge strategy policy
self.failUnlessRaises(KeyError, lambda: show_policy_output["settings"]["useSquashMerge"])
self.assertRaises(KeyError, lambda: show_policy_output["settings"]["useSquashMerge"])

update_policy_command = 'az repos policy merge-strategy update --id ' + str(policy_id) + ' --use-squash-merge True --output json --detect false'
update_policy_output = self.cmd(update_policy_command).get_output_in_json()
Expand All @@ -74,8 +74,8 @@ def test_repos_policies_createUpdateShowListDelete(self):
self.sleep_in_live_run(5)

show_policy_output = self.cmd(show_policy_command).get_output_in_json()
self.failUnlessRaises(KeyError, lambda: show_policy_output["settings"]["useSquashMerge"])
self.failUnlessRaises(KeyError, lambda: show_policy_output["settings"]["allowSquash"])
self.assertRaises(KeyError, lambda: show_policy_output["settings"]["useSquashMerge"])
self.assertRaises(KeyError, lambda: show_policy_output["settings"]["allowSquash"])
assert show_policy_output["settings"]["allowRebase"] == True

delete_policy_command = 'az repos policy delete --id ' + str(policy_id) + ' -p ' + created_project_id + ' --output json --detect false -y'
Expand Down Expand Up @@ -103,8 +103,8 @@ def test_repos_policies_createUpdateShowListDelete(self):

show_policy_command = 'az repos policy show --id ' + str(policy_id) + ' -p ' + created_project_id + ' --output json --detect false'
show_policy_output = self.cmd(show_policy_command).get_output_in_json()
self.failUnlessRaises(KeyError, lambda: show_policy_output["settings"]["useSquashMerge"])
self.failUnlessRaises(KeyError, lambda: show_policy_output["settings"]["allowRebase"])
self.assertRaises(KeyError, lambda: show_policy_output["settings"]["useSquashMerge"])
self.assertRaises(KeyError, lambda: show_policy_output["settings"]["allowRebase"])
assert show_policy_output["settings"]["allowSquash"] == True
assert show_policy_output["settings"]["allowRebaseMerge"] == True

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import os
import unittest

from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
from dateutil import parser
from .utilities.helper import (
DevopsScenarioTest, get_random_name, disable_telemetry, set_authentication, get_test_org_from_env_variable)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import os
import unittest

from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
from datetime import datetime
from .utilities.helper import (
DevopsScenarioTest, get_random_name, disable_telemetry, set_authentication, get_test_org_from_env_variable)
Expand All @@ -18,17 +18,17 @@ class AzReposPrPolicyTests(DevopsScenarioTest):
@disable_telemetry
@set_authentication
def test_pull_request_policies_workitems(self):
self.cmd('az devops configure --defaults organization=' + DEVOPS_CLI_TEST_ORGANIZATION)

self.cmd('az devops configure --defaults organization=' + DEVOPS_CLI_TEST_ORGANIZATION)
#List PR
pr_list = self.cmd('az repos pr list --project PullRequestLiveTest --repository PullRequestLiveTest --detect false --output json', checks=[
self.check("[0].description", 'Updated README.md'),
self.check("[1].description", 'Updated README.md'),
]).get_output_in_json()
assert len(pr_list) > 0

pr_id_to_query = pr_list[1]["pullRequestId"]
pr_id_to_query = pr_list[1]["pullRequestId"]

#PR Policies list command
list_pr_policies_command = 'az repos pr policy list --id ' + str(pr_id_to_query) + ' --detect false --output json'
list_pr_policies_output = self.cmd(list_pr_policies_command).get_output_in_json()
Expand All @@ -44,8 +44,8 @@ def test_pull_request_policies_workitems(self):
assert queue_pr_policy_output["status"] == 'queued'

#PR work-item add command
work_item_ids_to_add = '1 2'
work_item_id_to_remove = '2'
work_item_ids_to_add = '129 130'
work_item_id_to_remove = '130'

add_wit_pr_command = ('az repos pr work-item add --id ' + str(pr_id_to_query) + ' --work-items ' + work_item_ids_to_add +
' --detect false --output json')
Expand All @@ -63,7 +63,7 @@ def test_pull_request_policies_workitems(self):
self.cmd(remove_wit_pr_command)
#verify removed
list_wit_pr_output = self.cmd(list_wit_pr_command, checks=[
self.check("[0].id", "1")
self.check("[0].id", "129")
]).get_output_in_json()
assert len(list_wit_pr_output) == 1

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import os

from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
from .utilities.helper import (DevopsScenarioTest,
disable_telemetry,
get_random_name,
Expand Down
Loading

0 comments on commit 555e533

Please sign in to comment.