Skip to content

Commit

Permalink
Only test k8s-extension
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-innis committed Jul 8, 2022
1 parent 3ed7061 commit 36e59ab
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 8 deletions.
14 changes: 10 additions & 4 deletions src/k8s-extension/azext_k8s_extension/tests/latest/test_custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,23 @@
class TestIsDogfoodCluster(unittest.TestCase):
def test_dogfood_cluster(self):
cmd = MockCommand()
cmd.cli_ctx.cloud.endpoints.resource_manager = "https://api-dogfood.resources.windows-int.net"
cmd.cli_ctx.cloud.endpoints.resource_manager = (
"https://api-dogfood.resources.windows-int.net"
)
assert is_dogfood_cluster(cmd)

def test_dogfood_cluster_with_slash(self):
cmd = MockCommand()
cmd.cli_ctx.cloud.endpoints.resource_manager = "https://api-dogfood.resources.windows-int.net/"
cmd.cli_ctx.cloud.endpoints.resource_manager = (
"https://api-dogfood.resources.windows-int.net/"
)
assert is_dogfood_cluster(cmd)

def test_longer_hostname(self):
cmd = MockCommand()
cmd.cli_ctx.cloud.endpoints.resource_manager = "https://api-dogfood.resources.windows-int.otherwebsite.net/"
cmd.cli_ctx.cloud.endpoints.resource_manager = (
"https://api-dogfood.resources.windows-int.otherwebsite.net/"
)
assert not is_dogfood_cluster(cmd)

def malformed_url(self):
Expand All @@ -35,4 +41,4 @@ def malformed_url(self):
def test_prod_cluster(self):
cmd = MockCommand()
cmd.cli_ctx.cloud.endpoints.resource_manager = "https://management.azure.com"
assert not is_dogfood_cluster(cmd)
assert not is_dogfood_cluster(cmd)
22 changes: 18 additions & 4 deletions testing/pipeline/k8s-custom-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,25 @@ stages:
versionSpec: '$(python.version)'
- bash: pip install wheel==0.30.0
displayName: 'Install wheel==0.30.0'
- bash: ./scripts/ci/test_source.sh
- bash: |
set -ev
# prepare and activate virtualenv
pip install virtualenv
python -m virtualenv venv/
source ./venv/bin/activate
# clone azure-cli
git clone --single-branch -b dev https://github.com/Azure/azure-cli.git ../azure-cli
pip install --upgrade pip
pip install azdev
azdev --version
azdev setup -c ../azure-cli -r ./ -e k8s-extension
azdev test k8s-extension
displayName: 'Run integration test and build test'
env:
ADO_PULL_REQUEST_LATEST_COMMIT: $(System.PullRequest.SourceCommitId)
ADO_PULL_REQUEST_TARGET_BRANCH: $(System.PullRequest.TargetBranch)
- job: LintModifiedExtensions
displayName: "CLI Linter on Modified Extensions"
Expand Down

0 comments on commit 36e59ab

Please sign in to comment.