Datasets:

Modalities:
Tabular
Text
Formats:
json
Size:
< 1K
ArXiv:
DOI:
Libraries:
Datasets
Dask
galtimur's picture
Upload 78 files
8f0a8fd verified
{"language": "Python", "id": 67, "repo_owner": "canonical", "repo_name": "cloud-init", "head_branch": "main", "workflow_name": "Lint Tests", "workflow_filename": "check_format.yml", "workflow_path": ".github/workflows/check_format.yml", "contributor": "ani-sinha", "sha_fail": "55d2e8d4abb024997be878797d5625effad65d43", "sha_success": "9b3b3632cb86b74b79ed2b1fb3672a9f50604992", "workflow": "name: Lint Tests\non:\n pull_request:\n push:\n branches:\n - main\n\nconcurrency:\n group: 'ci-${{ github.workflow }}-${{ github.ref }}'\n cancel-in-progress: true\ndefaults:\n run:\n shell: sh -ex {0}\n\njobs:\n check_format:\n strategy:\n fail-fast: false\n matrix:\n env: [ruff, mypy, pylint, black, isort]\n lint-with:\n - {tip-versions: false, os: ubuntu-20.04}\n - {tip-versions: true, os: ubuntu-latest}\n name: Check ${{ matrix.lint-with.tip-versions && 'tip-' || '' }}${{ matrix.env }}\n runs-on: ${{ matrix.lint-with.os }}\n steps:\n - name: \"Checkout #1\"\n uses: actions/[email protected]\n\n - name: \"Checkout #2 (for tools/read-version)\"\n run: |\n git fetch --unshallow\n git remote add upstream https://git.launchpad.net/cloud-init\n\n - name: Dependencies\n run: |\n sudo DEBIAN_FRONTEND=noninteractive apt-get -qy update\n sudo DEBIAN_FRONTEND=noninteractive apt-get -qy install tox\n\n - name: Print version\n run: python3 --version\n\n - name: Test\n if: ${{ !matrix.lint-with.tip-versions }}\n env:\n # matrix env: not to be confused w/environment variables or testenv\n TOXENV: ${{ matrix.env }}\n run: tox\n - name: Test (tip versions)\n if: matrix.lint-with.tip-versions\n continue-on-error: true\n env:\n TOXENV: tip-${{ matrix.env }}\n run: tox\n schema-format:\n strategy:\n fail-fast: false\n name: Check json format\n runs-on: ubuntu-22.04\n steps:\n - name: \"Checkout #1\"\n uses: actions/[email protected]\n\n - name: \"Test format\"\n run: |\n tools/check_json_format.sh cloudinit/config/schemas/schema-cloud-config-v1.json\n tools/check_json_format.sh cloudinit/config/schemas/schema-network-config-v1.json\n tools/check_json_format.sh cloudinit/config/schemas/versions.schema.cloud-config.json\n\n doc:\n strategy:\n fail-fast: false\n name: Check docs\n runs-on: ubuntu-22.04\n steps:\n - name: \"Checkout #1\"\n uses: actions/[email protected]\n\n - name: \"Checkout #2 (for tools/read-version)\"\n run: |\n git fetch --unshallow\n git remote add upstream https://git.launchpad.net/cloud-init\n - name: \"Install Python 3.10\"\n uses: actions/setup-python@v4\n with:\n python-version: '3.10.8'\n - name: \"Install dependencies\"\n run: |\n sudo DEBIAN_FRONTEND=noninteractive apt-get -qy update\n sudo DEBIAN_FRONTEND=noninteractive apt-get -qy install tox lintian\n - name: \"Spellcheck\"\n run: |\n make check_spelling\n - name: \"Build docs\"\n env:\n TOXENV: doc\n run: |\n tox\n\n shell-lint:\n name: Shell Lint\n runs-on: ubuntu-22.04\n steps:\n - name: Checkout\n uses: actions/[email protected]\n\n - name: Install ShellCheck\n run: |\n sudo apt-get update\n sudo apt install shellcheck\n\n - name: Run ShellCheck\n run: |\n shellcheck ./tools/ds-identify\n\n check-cla-signers:\n runs-on: ubuntu-22.04\n steps:\n - uses: actions/[email protected]\n\n - name: Check CLA signers file\n run: tools/check-cla-signers\n", "logs": [{"step_name": "Check pylint/6_Test.txt", "log": "##[group]Run tox\n\u001b[36;1mtox\u001b[0m\nshell: /usr/bin/sh -ex {0}\nenv:\n TOXENV: pylint\n##[endgroup]\n+ tox\nGLOB sdist-make: /home/runner/work/cloud-init/cloud-init/setup.py\npylint create: /home/runner/work/cloud-init/cloud-init/.tox/pylint\npylint installdeps: pylint===2.13.9, -r/home/runner/work/cloud-init/cloud-init/test-requirements.txt, -r/home/runner/work/cloud-init/cloud-init/integration-requirements.txt\npylint inst: /home/runner/work/cloud-init/cloud-init/.tox/.tmp/package/1/cloud-init-23.4+28.ge396f22f.zip\npylint installed: adal==1.2.7,appdirs==1.4.4,applicationinsights==0.11.10,argcomplete==3.1.6,astroid==2.11.7,attrs==23.1.0,autopage==0.5.2,azure-cli-core==2.55.0,azure-cli-telemetry==1.1.0,azure-common==1.1.28,azure-core==1.29.5,azure-identity==1.15.0,azure-mgmt-compute==30.3.0,azure-mgmt-core==1.4.0,azure-mgmt-network==25.1.0,azure-mgmt-resource==23.0.1,bcrypt==4.1.1,boto3==1.33.9,botocore==1.33.9,cachetools==5.3.2,certifi==2023.11.17,cffi==1.16.0,charset-normalizer==3.3.2,circuitbreaker==1.4.0,cliff==4.4.0,cloud-init==23.4+28.ge396f22f,cmd2==2.4.3,configobj==5.0.8,coverage==7.3.2,cryptography==41.0.7,debtcollector==2.5.0,decorator==5.1.1,dill==0.3.7,distro==1.8.0,dogpile.cache==1.2.2,exceptiongroup==1.2.0,google-api-core==2.14.0,google-api-python-client==2.109.0,google-auth==2.25.1,google-auth-httplib2==0.1.1,googleapis-common-protos==1.61.0,httplib2==0.22.0,humanfriendly==10.0,ibm-cloud-sdk-core==3.18.0,ibm-platform-services==0.47.1,ibm-vpc==0.20.0,idna==3.6,importlib-metadata==7.0.0,importlib-resources==6.1.1,iniconfig==2.0.0,iso8601==2.1.0,isodate==0.6.1,isort==5.12.0,Jinja2==3.1.2,jmespath==1.0.1,jsonpatch==1.33,jsonpointer==2.4,jsonschema==4.20.0,jsonschema-specifications==2023.11.2,keystoneauth1==5.4.0,knack==0.11.0,lazy-object-proxy==1.9.0,MarkupSafe==2.1.3,mccabe==0.7.0,msal==1.26.0,msal-extensions==1.0.0,msgpack==1.0.7,msrest==0.7.1,msrestazure==0.6.4,netaddr==0.9.0,netifaces==0.11.0,oauthlib==3.2.2,oci==2.117.0,openstacksdk==1.4.0,os-service-types==1.7.0,osc-lib==2.9.0,oslo.config==9.2.0,oslo.i18n==6.2.0,oslo.serialization==5.2.0,oslo.utils==6.3.0,packaging==23.2,paramiko==3.3.1,passlib==1.7.4,pbr==6.0.0,pkginfo==1.9.6,pkgutil-resolve-name==1.3.10,platformdirs==4.1.0,pluggy==1.3.0,portalocker==2.8.2,prettytable==3.9.0,protobuf==3.19.6,psutil==5.9.6,pyasn1==0.5.1,pyasn1-modules==0.3.0,pycloudlib==1!5.11.0,pycparser==2.21,pygments==2.17.2,PyJWT==2.8.0,pylint==2.13.9,PyNaCl==1.5.0,pyOpenSSL==23.3.0,pyparsing==2.4.7,pyperclip==1.8.2,pyserial==3.5,pytest==7.4.3,pytest-cov==4.1.0,pytest-mock==3.12.0,python-cinderclient==9.4.0,python-dateutil==2.8.2,python-keystoneclient==5.2.0,python-novaclient==18.4.0,python-openstackclient==6.4.0,pytz==2023.3.post1,PyYAML==6.0.1,qemu.qmp==0.0.3,referencing==0.31.1,requests==2.31.0,requests-oauthlib==1.3.1,requestsexceptions==1.4.0,responses==0.24.1,rfc3986==2.0.0,rpds-py==0.13.2,rsa==4.9,s3transfer==0.8.2,simplejson==3.19.2,six==1.16.0,stevedore==5.1.0,tabulate==0.9.0,toml==0.10.0,tomli==2.0.1,typing-extensions==4.8.0,tzdata==2023.3,uritemplate==4.1.1,urllib3==2.1.0,wcwidth==0.2.12,wrapt==1.16.0,zipp==3.17.0\npylint run-test-pre: PYTHONHASHSEED='1481622646'\npylint run-test: commands[0] | /home/runner/work/cloud-init/cloud-init/.tox/pylint/bin/python -m pylint cloudinit/ tests/ tools/ conftest.py setup.py\n************* Module tests.unittests.test_net_activators\ntests/unittests/test_net_activators.py:329: [E0213(no-self-argument), TestNetworkManagerActivatorBringUp.fake_isfile_no_nmconn] Method should have \"self\" as first argument\ntests/unittests/test_net_activators.py:330: [E1101(no-member), TestNetworkManagerActivatorBringUp.fake_isfile_no_nmconn] Instance of 'TestNetworkManagerActivatorBringUp' has no 'endswith' member\n\n------------------------------------\nYour code has been rated at 10.00/10\n\nERROR: InvocationError for command /home/runner/work/cloud-init/cloud-init/.tox/pylint/bin/python -m pylint cloudinit/ tests/ tools/ conftest.py setup.py (exited with code 2)\n___________________________________ summary ____________________________________\nERROR: pylint: commands failed\n##[error]Process completed with exit code 1.\n"}], "diff": "diff --git a/tests/unittests/test_net_activators.py b/tests/unittests/test_net_activators.py\nindex 0b3c11c1a..c14425fd6 100644\n--- a/tests/unittests/test_net_activators.py\n+++ b/tests/unittests/test_net_activators.py\n@@ -326,15 +326,12 @@ class TestActivatorsBringDown:\n \n \n class TestNetworkManagerActivatorBringUp:\n- def fake_isfile_no_nmconn(filename):\n- return False if filename.endswith(\".nmconnection\") else True\n-\n @patch(\"cloudinit.subp.subp\", return_value=(\"\", \"\"))\n @patch(\n \"cloudinit.net.network_manager.available_nm_ifcfg_rh\",\n return_value=True,\n )\n- @patch.object(os.path, \"isfile\", side_effect=fake_isfile_no_nmconn)\n+ @patch.object(os.path, \"isfile\")\n @patch(\"os.path.exists\", return_value=True)\n def test_bring_up_interface_no_nm_conn(\n self, m_exists, m_isfile, m_plugin, m_subp\n@@ -344,6 +341,12 @@ class TestNetworkManagerActivatorBringUp:\n present and ifcfg interface config files are also present. In this\n case, we should use ifcfg files.\n \"\"\"\n+\n+ def fake_isfile_no_nmconn(filename):\n+ return False if filename.endswith(\".nmconnection\") else True\n+\n+ m_isfile.side_effect = fake_isfile_no_nmconn\n+\n expected_call_list = [\n (\n (\n@@ -377,6 +380,7 @@ class TestNetworkManagerActivatorBringUp:\n {},\n ),\n ]\n+\n index = 0\n assert NetworkManagerActivator.bring_up_interface(\"eth0\")\n for call in m_subp.call_args_list:\n@@ -388,7 +392,7 @@ class TestNetworkManagerActivatorBringUp:\n \"cloudinit.net.network_manager.available_nm_ifcfg_rh\",\n return_value=False,\n )\n- @patch.object(os.path, \"isfile\", side_effect=fake_isfile_no_nmconn)\n+ @patch.object(os.path, \"isfile\")\n @patch(\"os.path.exists\", return_value=True)\n def test_bring_up_interface_no_plugin_no_nm_conn(\n self, m_exists, m_isfile, m_plugin, m_subp\n@@ -398,6 +402,11 @@ class TestNetworkManagerActivatorBringUp:\n not present. In this case, we can't use ifcfg file and the\n interface bring up should fail.\n \"\"\"\n+\n+ def fake_isfile_no_nmconn(filename):\n+ return False if filename.endswith(\".nmconnection\") else True\n+\n+ m_isfile.side_effect = fake_isfile_no_nmconn\n assert not NetworkManagerActivator.bring_up_interface(\"eth0\")\n \n @patch(\"cloudinit.subp.subp\", return_value=(\"\", \"\"))\n", "difficulty": 2, "changed_files": ["tests/unittests/test_net_activators.py"], "commit_link": "https://github.com/canonical/cloud-init/tree/55d2e8d4abb024997be878797d5625effad65d43"}