Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding 2024-04-10 api version fior AzureLargeInstance #7690

Merged

Conversation

8Gitbrix
Copy link
Member

@8Gitbrix 8Gitbrix commented Jun 6, 2024


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

Related command

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)
  • My extension version conforms to the Extension version schema

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

Copy link

azure-client-tools-bot-prd bot commented Jun 6, 2024

️✔️Azure CLI Extensions Breaking Change Test
️✔️Non Breaking Changes

Copy link

Hi @8Gitbrix,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

@yonzhan
Copy link
Collaborator

yonzhan commented Jun 6, 2024

Thank you for your contribution! We will review the pull request and get back to you soon.

@8Gitbrix 8Gitbrix changed the title Adding 2024-04-10 api version Adding 2024-04-10 api version fior AzureLargeInstance Jun 6, 2024
Copy link

github-actions bot commented Jun 6, 2024

For more info about extension versioning, please refer to Extension version schema

@8Gitbrix
Copy link
Member Author

8Gitbrix commented Jun 7, 2024

For some reason the tests are failing. They were failing in the first commit since the resources I was previously using were deleted. I've since updated them and tested the commands individually. Can someone help me understand how the tests are still failing?

@8Gitbrix
Copy link
Member Author

8Gitbrix commented Jun 7, 2024

When running azdev test azurelargeinstance, I get this error, but it doesn't explain how the assertion fails. Running these commands individually works though.

/Users/ashwinjeyaseelan/clienv/lib/python3.10/site-packages/_pytest/config/__init__.py:318: PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown.
Plugin: helpconfig, Hook: pytest_cmdline_parse
AssertionError: 
For more information see https://pluggy.readthedocs.io/en/stable/api_reference.html#pluggy.PluggyTeardownRaisedWarning
  config = pluginmanager.hook.pytest_cmdline_parse(
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/Users/ashwinjeyaseelan/clienv/lib/python3.10/site-packages/pytest/__main__.py", line 5, in <module>
    raise SystemExit(pytest.console_main())
  File "/Users/ashwinjeyaseelan/clienv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 185, in console_main
    code = main()
  File "/Users/ashwinjeyaseelan/clienv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 143, in main
    config = _prepareconfig(args, plugins)
  File "/Users/ashwinjeyaseelan/clienv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 318, in _prepareconfig
    config = pluginmanager.hook.pytest_cmdline_parse(
  File "/Users/ashwinjeyaseelan/clienv/lib/python3.10/site-packages/pluggy/_hooks.py", line 513, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  File "/Users/ashwinjeyaseelan/clienv/lib/python3.10/site-packages/pluggy/_manager.py", line 120, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/Users/ashwinjeyaseelan/clienv/lib/python3.10/site-packages/pluggy/_callers.py", line 156, in _multicall
    teardown[0].send(outcome)
  File "/Users/ashwinjeyaseelan/clienv/lib/python3.10/site-packages/_pytest/helpconfig.py", line 100, in pytest_cmdline_parse
    config: Config = outcome.get_result()
  File "/Users/ashwinjeyaseelan/clienv/lib/python3.10/site-packages/pluggy/_result.py", line 100, in get_result
    raise exc.with_traceback(exc.__traceback__)
  File "/Users/ashwinjeyaseelan/clienv/lib/python3.10/site-packages/pluggy/_callers.py", line 103, in _multicall
    res = hook_impl.function(*args)
  File "/Users/ashwinjeyaseelan/clienv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1003, in pytest_cmdline_parse
    self.parse(args)
  File "/Users/ashwinjeyaseelan/clienv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1283, in parse
    self._preparse(args, addopts=addopts)
  File "/Users/ashwinjeyaseelan/clienv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1172, in _preparse
    self.pluginmanager.load_setuptools_entrypoints("pytest11")
  File "/Users/ashwinjeyaseelan/clienv/lib/python3.10/site-packages/pluggy/_manager.py", line 422, in load_setuptools_entrypoints
    self.register(plugin, name=ep.name)
  File "/Users/ashwinjeyaseelan/clienv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 436, in register
    ret: Optional[str] = super().register(plugin, name)
  File "/Users/ashwinjeyaseelan/clienv/lib/python3.10/site-packages/pluggy/_manager.py", line 169, in register
    hook._maybe_apply_history(hookimpl)
  File "/Users/ashwinjeyaseelan/clienv/lib/python3.10/site-packages/pluggy/_hooks.py", line 581, in _maybe_apply_history
    res = self._hookexec(self.name, [method], kwargs, False)
  File "/Users/ashwinjeyaseelan/clienv/lib/python3.10/site-packages/pluggy/_manager.py", line 120, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/Users/ashwinjeyaseelan/clienv/lib/python3.10/site-packages/pluggy/_callers.py", line 139, in _multicall
    raise exception.with_traceback(exception.__traceback__)
  File "/Users/ashwinjeyaseelan/clienv/lib/python3.10/site-packages/pluggy/_callers.py", line 103, in _multicall
    res = hook_impl.function(*args)
  File "/Users/ashwinjeyaseelan/clienv/lib/python3.10/site-packages/xdist/plugin.py", line 189, in pytest_addoption
    parser.addini(
  File "/Users/ashwinjeyaseelan/clienv/lib/python3.10/site-packages/_pytest/config/argparsing.py", line 179, in addini
    assert type in (None, "string", "pathlist", "args", "linelist", "bool")
AssertionError

@8Gitbrix
Copy link
Member Author

8Gitbrix commented Jun 7, 2024

pip install pytest==7.0.0 --use-deprecated=legacy-resolver got rid of that error but now I'm running into a bunch of thread errors in the test which look unrelated:

platform darwin -- Python 3.10.11, pytest-7.0.0, pluggy-0.13.1 -- /Users/ashwinjeyaseelan/clienv/bin/python
cachedir: .pytest_cache
rootdir: /Users/ashwinjeyaseelan/Documents/azure-cli-extensions/src/azurelargeinstance
plugins: forked-1.6.0, xdist-3.6.1
10 workers [4 items]      
scheduling tests via LoadScheduling

src/azurelargeinstance/azext_azurelargeinstance/tests/latest/test_azurelargeinstance.py::AzurelargeinstanceScenario::test_list_azurelargeinstances_in_subscription 
src/azurelargeinstance/azext_azurelargeinstance/tests/latest/test_azurelargeinstance.py::AzurelargeinstanceScenario::test_list_azurelargeinstances_in_resourcegroup 
src/azurelargeinstance/azext_azurelargeinstance/tests/latest/test_azurelargeinstance.py::AzurelargeinstanceScenario::test_list_azurelargestorageinstances_in_subscription 
src/azurelargeinstance/azext_azurelargeinstance/tests/latest/test_azurelargeinstance.py::AzurelargeinstanceScenario::test_list_azurelargestorageinstances_in_resourcegroup Fatal Python error: Fatal Python error: Fatal Python error: Fatal Python error: AbortedAbortedAbortedAborted
[gw2] [ 25%] FAILED src/azurelargeinstance/azext_azurelargeinstance/tests/latest/test_azurelargeinstance.py::AzurelargeinstanceScenario::test_list_azurelargestorageinstances_in_subscription objc[84579]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
objc[84579]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.

[gw3] [ 50%] FAILED src/azurelargeinstance/azext_azurelargeinstance/tests/latest/test_azurelargeinstance.py::AzurelargeinstanceScenario::test_list_azurelargestorageinstances_in_resourcegroup objc[84578]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
objc[84578]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.

[gw0] [ 75%] FAILED src/azurelargeinstance/azext_azurelargeinstance/tests/latest/test_azurelargeinstance.py::AzurelargeinstanceScenario::test_list_azurelargeinstances_in_resourcegroup objc[84576]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
objc[84576]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.

[gw1] [100%] FAILED src/azurelargeinstance/azext_azurelargeinstance/tests/latest/test_azurelargeinstance.py::AzurelargeinstanceScenario::test_list_azurelargeinstances_in_subscription objc[84577]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
objc[84577]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.

What version of pytest is needed? This is confusing. aaz-dev requires pytest 6.2.0,. But when downgrading, it complains that pytest-xdist package requires pytest 7.0.0 or higher...

@8Gitbrix
Copy link
Member Author

8Gitbrix commented Jun 7, 2024

Was able to get tests running on mac by exporting this flag export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES. But one test is failing. Will work with team to fix this.

Also Azure/aaz#493 for the previous api version needs to be merged

Copy link

CodeGen Tools Feedback Collection

Thank you for using our CodeGen tool. We value your feedback, and we would like to know how we can improve our product. Please take a few minutes to fill our codegen survey

@kairu-ms
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@kairu-ms
Copy link
Contributor

Hi @8Gitbrix, please fix these lint issues https://dev.azure.com/azclitools/public/_build/results?buildId=168363&view=logs&j=e2e497a5-ba27-5eb9-f39e-d929d56974a6&t=61cc2d02-f6f4-5007-71e9-5651933c3fe7&l=167

Please verify the following breaking change is by design or not.

❌Azure CLI Extensions Breaking Change Test

❌azurelargeinstance

rule
cmd_name
rule_message
suggest_message

1006 - ParaAdd
large-instance restart
cmd large-instance restart added parameter azure_large_instance_name
please remove parameter azure_large_instance_name for cmd large-instance restart

1007 - ParaRemove
large-instance restart
cmd large-instance restart removed parameter instance_name
please add back parameter instance_name for cmd large-instance restart

1006 - ParaAdd
large-instance show
cmd large-instance show added parameter azure_large_instance_name
please remove parameter azure_large_instance_name for cmd large-instance show

1007 - ParaRemove
large-instance show
cmd large-instance show removed parameter instance_name
please add back parameter instance_name for cmd large-instance show

1006 - ParaAdd
large-instance shutdown
cmd large-instance shutdown added parameter azure_large_instance_name
please remove parameter azure_large_instance_name for cmd large-instance shutdown

1007 - ParaRemove
large-instance shutdown
cmd large-instance shutdown removed parameter instance_name
please add back parameter instance_name for cmd large-instance shutdown

1006 - ParaAdd
large-instance start
cmd large-instance start added parameter azure_large_instance_name
please remove parameter azure_large_instance_name for cmd large-instance start

1007 - ParaRemove
large-instance start
cmd large-instance start removed parameter instance_name
please add back parameter instance_name for cmd large-instance start

1006 - ParaAdd
large-instance update
cmd large-instance update added parameter azure_large_instance_name
please remove parameter azure_large_instance_name for cmd large-instance update

1007 - ParaRemove
large-instance update
cmd large-instance update removed parameter instance_name
please add back parameter instance_name for cmd large-instance update

1006 - ParaAdd
large-storage-instance show
cmd large-storage-instance show added parameter azure_large_storage_instance_name
please remove parameter azure_large_storage_instance_name for cmd large-storage-instance show

1007 - ParaRemove
large-storage-instance show
cmd large-storage-instance show removed parameter instance_name
please add back parameter instance_name for cmd large-storage-instance show

1006 - ParaAdd
large-storage-instance update
cmd large-storage-instance update added parameter azure_large_storage_instance_name
please remove parameter azure_large_storage_instance_name for cmd large-storage-instance update

1007 - ParaRemove
large-storage-instance update
cmd large-storage-instance update removed parameter instance_name
please add back parameter instance_name for cmd large-storage-instance update

@kairu-ms
Copy link
Contributor

kairu-ms commented Jul 1, 2024

Hi @8Gitbrix, if the following breaking changes are by design, please update the release notes for them. Thanks.

❌Azure CLI Extensions Breaking Change Test

❌azurelargeinstance

rule
cmd_name
rule_message
suggest_message

1006 - ParaAdd
large-instance show
cmd large-instance show added parameter azure_large_instance_name
please remove parameter azure_large_instance_name for cmd large-instance show

1007 - ParaRemove
large-instance show
cmd large-instance show removed parameter instance_name
please add back parameter instance_name for cmd large-instance show

1006 - ParaAdd
large-instance update
cmd large-instance update added parameter azure_large_instance_name
please remove parameter azure_large_instance_name for cmd large-instance update

1007 - ParaRemove
large-instance update
cmd large-instance update removed parameter instance_name
please add back parameter instance_name for cmd large-instance update

@8Gitbrix
Copy link
Member Author

8Gitbrix commented Jul 1, 2024

@kairu-ms Thanks for catching that. There shouldn't be any breaking changes. I corrected the parameter names for those methods. Let me know if there's any other things I've missed.

@kairu-ms kairu-ms merged commit e269018 into Azure:main Jul 2, 2024
18 checks passed
@azclibot
Copy link
Collaborator

azclibot commented Jul 2, 2024

[Release] Update index.json for extension [ azurelargeinstance ] : https://dev.azure.com/azclitools/release/_build/results?buildId=169200&view=results

@8Gitbrix 8Gitbrix deleted the feature-add-ali-api-version-2024-04-10 branch July 2, 2024 21:59
liorstauber pushed a commit to liorstauber/azure-cli-extensions that referenced this pull request Jul 14, 2024
* Adding 2024-04-10 api version

* Added updates to history.rst and updated version in setup.py

* Updated tests since previous resource was deleted

* Updated recorded tests

* Fixed parameter name

* Fixing parameter names

* Update src/azurelargeinstance/azext_azurelargeinstance/aaz/latest/large_instance/_update.py

---------

Co-authored-by: Ashwin Jeyaseelan <[email protected]>
Co-authored-by: Ashwin Jeyaseelan <[email protected]>
Co-authored-by: kai ru <[email protected]>
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.

None yet

5 participants