Azure-cli: ACR Task test will not re-record

Created on 20 Feb 2019  路  4Comments  路  Source: Azure/azure-cli

Describe the bug
When attempting to re-record tests for a bump in the Network API version, the test_acr_task fails with a 401 unauthorized error. I believe the problem lies in these lines of code in the test:

            # This token requires 'admin:repo_hook' access. Recycle the token after recording tests.
            'git_access_token': 'c79e207682b7aeea3d94313f66f0dc328c1c4a62',
            'context': 'https://github.com/ankurkhemani/acr-helloworld.git',

To work around this, I have converted the test to a LiveScenarioTest so that it will not block CI.

To Reproduce
Run azdev test test_acr_task --live

Expected behavior
Test should be written in a way that it can be re-recorded without manual steps.

Environment summary
Install Method (e.g. pip, interactive script, apt-get, Docker, MSI, edge build) / CLI version (az --version) / OS version / Shell Type (e.g. bash, cmd.exe, Bash on Windows)

azure-cli                         2.0.59

acr                                2.2.0
acs                               2.3.17
advisor                            2.0.0
ams                                0.4.1
appservice                        0.2.13
backup                             1.2.1
batch                              3.4.1
batchai                            0.4.7
billing                            0.2.0
botservice                         0.1.6
cdn                                0.2.0
cloud                              2.1.0
cognitiveservices                  0.2.4
command-modules-nspkg               2.0.2
configure                         2.0.20
consumption                        0.4.2
container                         0.3.13
core                              2.0.59
cosmosdb                           0.2.7
dev-tools                          0.1.1
dla                                0.2.4
dls                                0.1.8
dms                                0.1.2
eventgrid                          0.2.1
eventhubs                          0.3.3
extension                          0.2.3
feedback                           2.1.4
find                              0.2.13
hdinsight                          0.3.0
interactive                        0.4.1
iot                                0.3.6
iotcentral                         0.1.6
keyvault                          2.2.11
kusto                              0.1.0
lab                                0.1.5
maps                               0.3.3
monitor                           0.2.10
network                            2.3.2
nspkg                              3.0.3
policyinsights                     0.1.1
profile                            2.1.3
rdbms                              0.3.7
redis                              0.4.0
relay                              0.1.3
reservations                       0.4.1
resource                          2.1.10
role                               2.4.0
search                             0.1.1
security                           0.1.0
servicebus                         0.3.3
servicefabric                     0.1.12
signalr                            1.0.0
sql                                2.1.9
sqlvirtualmachine                  0.1.0
sqlvm                              0.1.0
storage                            2.3.1
telemetry                          1.0.1
testsdk                            0.2.4
vm                                2.2.15

Extensions:
alias                              0.5.2
interactive                        0.4.1
find                               0.3.0

Python location '/Users/travisprescott/github/env/bin/python'
Extensions directory '/Users/travisprescott/.azure/cliextensions'
Development extension sources:
    /Users/travisprescott/github/azure-cli-extensions

Python (Darwin) 3.7.2 (default, Jan 31 2019, 09:23:28) 
[Clang 10.0.0 (clang-1000.11.45.5)]

Legal docs and information: aka.ms/AzureCliLegal


Your CLI is up-to-date.
Container Registry Service Attention Test Framework bug

All 4 comments

// cc @jaysterp who is looking into this.

The git access token did not have sufficient permissions. Replaced the token in the test and --live works correctly. The issue can be closed. //cc @tjprescott

@jaysterp this issue should only be close once the test has been converted back to a ScenarioTest.

@tjprescott the tests were converted back to ScenarioTest and merged in https://github.com/Azure/azure-cli/pull/9655

Was this page helpful?
0 / 5 - 0 ratings