Skip to content

Conversation

@evelyn-ys
Copy link
Member

@evelyn-ys evelyn-ys commented Mar 24, 2021

Description
Recently CI fails like this:

AssertionError: Can't overwrite existing cassette ('/home/vsts/work/1/s/src/azure-cli/azure/cli/command_modules/eventgrid/tests/latest/recordings/test_create_topic.yaml') in your current record mode ('once').
No match for the request (<Request (PUT) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002?api-version=2020-04-01-preview>) was found.
Found 1 similar requests with 1 different matcher(s) :

1 - (<Request (PUT) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.EventGrid/topics/cli000002?api-version=2020-10-15-preview>).

This PR fix CI.

Cause
From pipeline log we can find that all eventgrid module tests fail. It says no match requests found for api version 2020-04-01-preview, only api version 2020-10-15-preview found.

But api version 2020-10-15-preview is expected as #17361 has upgraded eventgrid from 2020-04-01-preview to 2020-10-15-preview. The CI tests failed because all eventgrid commands used the code in eventgrid extension which hasn't upgraded version.

Then we found that eventgrid extension was added manually in network module(L851):

class NetworkPrivateLinkEventGridScenarioTest(ScenarioTest):
@AllowLargeResponse()
def setUp(self):
super(NetworkPrivateLinkEventGridScenarioTest, self).setUp()
self.cmd('extension add -n eventgrid')
def tearDown(self):
# self.cmd('extension remove -n eventgrid')
super(NetworkPrivateLinkEventGridScenarioTest, self).tearDown()

The eventgrid extension should be removed after network tests end, but the removing code(L854) was commented out in #17290

So if CI run network tests before eventgrid tests, eventgrid tests will be redirected to eventgrid extension code, which will cause failure after the eventgrid in main repo has upgraded version.


This checklist is used to make sure that common guidelines for a pull request are followed.

@evelyn-ys evelyn-ys requested a review from Juliehzl March 24, 2021 11:03
@evelyn-ys evelyn-ys self-assigned this Mar 24, 2021
@yonzhan
Copy link
Collaborator

yonzhan commented Mar 24, 2021

Network

@yonzhan yonzhan added this to the S185 milestone Mar 24, 2021
@yonzhan yonzhan requested a review from jiasli March 24, 2021 11:12
@jiasli
Copy link
Member

jiasli commented Mar 24, 2021

Very clear, comprehensive and comprehensible analysis! Nice work!

@jiasli
Copy link
Member

jiasli commented Mar 25, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@jiasli
Copy link
Member

jiasli commented Mar 25, 2021

#17432 (comment) solves the CI failure:

https://dev.azure.com/azure-sdk/public/_build/results?buildId=801336&view=logs&j=34631516-3f1c-501b-e428-6ea670d20b1c&t=4ecab084-061a-520a-6791-4f5413067b6d&l=1816

  File "/opt/az/azcliextensions/arcappliance/azext_arcappliance/custom.py", line 7, in <module>
    from azext_arcappliance.pkg.providers.shared import crud as kva_logic
  File "/opt/az/azcliextensions/arcappliance/azext_arcappliance/pkg/providers/shared/crud.py", line 2, in <module>
    from azext_arcappliance.pkg.providers.hci.logic.util import validateAndCreateHCIConfig
  File "/opt/az/azcliextensions/arcappliance/azext_arcappliance/pkg/providers/hci/logic/util.py", line 4, in <module>
    from azext_arcappliance.pkg.resource.logic import util as resource_util
  File "/opt/az/azcliextensions/arcappliance/azext_arcappliance/pkg/resource/logic/util.py", line 5, in <module>
    from jsonschema import validate, ValidationError
  File "/opt/az/azcliextensions/azure-iot/jsonschema/__init__.py", line 33, in <module>
    __version__ = get_distribution(__name__).version
  File "/opt/hostedtoolcache/Python/3.6.13/x64/lib/python3.6/site-packages/pkg_resources/__init__.py", line 479, in get_distribution
    dist = get_provider(dist)
  File "/opt/hostedtoolcache/Python/3.6.13/x64/lib/python3.6/site-packages/pkg_resources/__init__.py", line 355, in get_provider
    return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
  File "/opt/hostedtoolcache/Python/3.6.13/x64/lib/python3.6/site-packages/pkg_resources/__init__.py", line 898, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/opt/hostedtoolcache/Python/3.6.13/x64/lib/python3.6/site-packages/pkg_resources/__init__.py", line 784, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'jsonschema' distribution was not found and is required by the application

@jiasli
Copy link
Member

jiasli commented Mar 25, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@evelyn-ys evelyn-ys merged commit d727390 into Azure:dev Mar 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants