Skip to content

[skip changelog] Temporarily full pin Python in integration test CI workflow #1442

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

Merged
merged 1 commit into from
Sep 10, 2021
Merged

[skip changelog] Temporarily full pin Python in integration test CI workflow #1442

merged 1 commit into from
Sep 10, 2021

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Sep 10, 2021

Please check if the PR fulfills these requirements

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)
  • What kind of change does this PR introduce?

Infrastructure fix

  • What is the current behavior?

A bug introduced in the 3.9.7 release of Python causes a spurious failure of the test\test_lib.py::test_install_git_invalid_library integration test:

Click to expand
[gw1] FAILED test/test_lib.py::test_install_git_invalid_library 

=================================== FAILURES ===================================
_______________________ test_install_git_invalid_library _______________________
[gw1] darwin -- Python 3.9.7 /Users/runner/Library/Caches/pypoetry/virtualenvs/arduino-cli-5LFazWvB-py3.9/bin/python

run_command = <function run_command.<locals>._run at 0x105869e50>
data_dir = '/private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/pytest-of-runner/pytest-0/popen-gw1/ArduinoTest0'
task: Failed to run task "go:test-integration": exit status 2
downloads_dir = '/private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/pytest-of-runner/pytest-0/popen-gw1/ArduinoTest'

    def test_install_git_invalid_library(run_command, data_dir, downloads_dir):
        # Initialize configs to enable --zip-path flag
        env = {
            "ARDUINO_DATA_DIR": data_dir,
            "ARDUINO_DOWNLOADS_DIR": downloads_dir,
            "ARDUINO_SKETCHBOOK_DIR": data_dir,
            "ARDUINO_ENABLE_UNSAFE_LIBRARY_INSTALL": "true",
        }
        assert run_command("config init --dest-dir .", custom_env=env)
    
        # Create fake library repository
        repo_dir = Path(data_dir, "lib-without-header")
        with Repo.init(repo_dir) as repo:
            lib_properties = Path(repo_dir, "library.properties")
            lib_properties.touch()
            repo.index.add([str(lib_properties)])
>           repo.index.commit("First commit")

test/test_lib.py:957: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <git.index.base.IndexFile object at 0x105475c70>
message = 'First commit', parent_commits = None, head = True, author = None
committer = None, author_date = None, commit_date = None, skip_hooks = False

    def commit(self,
               message: str,
               parent_commits: Union[Commit_ish, None] = None,
               head: bool = True,
               author: Union[None, 'Actor'] = None,
               committer: Union[None, 'Actor'] = None,
               author_date: Union[str, None] = None,
               commit_date: Union[str, None] = None,
               skip_hooks: bool = False) -> Commit:
        """Commit the current default index file, creating a commit object.
        For more information on the arguments, see tree.commit.
    
        :note: If you have manually altered the .entries member of this instance,
               don't forget to write() your changes to disk beforehand.
               Passing skip_hooks=True is the equivalent of using `-n`
               or `--no-verify` on the command line.
        :return: Commit object representing the new commit"""
        if not skip_hooks:
            run_commit_hook('pre-commit', self)
    
            self._write_commit_editmsg(message)
            run_commit_hook('commit-msg', self, self._commit_editmsg_filepath())
            message = self._read_commit_editmsg()
            self._remove_commit_editmsg()
>       tree = self.write_tree()

../../../Library/Caches/pypoetry/virtualenvs/arduino-cli-5LFazWvB-py3.9/lib/python3.9/site-packages/git/index/base.py:1000: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <git.index.base.IndexFile object at 0x105475c70>

    def write_tree(self) -> Tree:
        """Writes this index to a corresponding Tree object into the repository's
        object database and return it.
    
        :return: Tree object representing this index
        :note: The tree will be written even if one or more objects the tree refers to
            does not yet exist in the object database. This could happen if you added
            Entries to the index directly.
        :raise ValueError: if there are no entries in the cache
        :raise UnmergedEntriesError: """
        # we obtain no lock as we just flush our contents to disk as tree
        # If we are a new index, the entries access will load our data accordingly
        mdb = MemoryDB()
        entries = self._entries_sorted()
        binsha, tree_items = write_tree_from_cache(entries, mdb, slice(0, len(entries)))
    
        # copy changed trees only
        mdb.stream_copy(mdb.sha_iter(), self.repo.odb)
    
        # note: additional deserialization could be saved if write_tree_from_cache
        # would return sorted tree entries
>       root_tree = Tree(self.repo, binsha, path='')

../../../Library/Caches/pypoetry/virtualenvs/arduino-cli-5LFazWvB-py3.9/lib/python3.9/site-packages/git/index/base.py:574: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <[AttributeError('binsha') raised in repr()] Tree object at 0x105290950>
repo = <git.repo.base.Repo '/private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/pytest-of-runner/pytest-0/popen-gw1/ArduinoTest0/lib-without-header/.git'>
binsha = b'm\xf9\x0b\xe8N1C;\xda\x9a\xc8\x11b\xf8D\x15\xc0\xdd\x02\xbf'
mode = 16384, path = ''

    def __init__(self, repo: 'Repo', binsha: bytes, mode: int = tree_id << 12, path: Union[PathLike, None] = None):
>       super(Tree, self).__init__(repo, binsha, mode, path)

../../../Library/Caches/pypoetry/virtualenvs/arduino-cli-5LFazWvB-py3.9/lib/python3.9/site-packages/git/objects/tree.py:215: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <[AttributeError('binsha') raised in repr()] Tree object at 0x105290950>
repo = <git.repo.base.Repo '/private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/pytest-of-runner/pytest-0/popen-gw1/ArduinoTest0/lib-without-header/.git'>
binsha = b'm\xf9\x0b\xe8N1C;\xda\x9a\xc8\x11b\xf8D\x15\xc0\xdd\x02\xbf'
mode = 16384, path = ''

    def __init__(self,
                 repo: 'Repo', binsha: bytes, mode: Union[None, int] = None, path: Union[None, PathLike] = None
                 ) -> None:
        """Initialize a newly instanced IndexObject
    
        :param repo: is the Repo we are located in
        :param binsha: 20 byte sha1
        :param mode:
            is the stat compatible file mode as int, use the stat module
            to evaluate the information
        :param path:
            is the path to the file in the file system, relative to the git repository root, i.e.
            file.ext or folder/other.ext
        :note:
            Path may not be set of the index object has been created directly as it cannot
            be retrieved without knowing the parent tree."""
>       super(IndexObject, self).__init__(repo, binsha)

../../../Library/Caches/pypoetry/virtualenvs/arduino-cli-5LFazWvB-py3.9/lib/python3.9/site-packages/git/objects/base.py:168: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <[AttributeError('binsha') raised in repr()] Tree object at 0x105290950>
repo = <git.repo.base.Repo '/private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/pytest-of-runner/pytest-0/popen-gw1/ArduinoTest0/lib-without-header/.git'>
binsha = b'm\xf9\x0b\xe8N1C;\xda\x9a\xc8\x11b\xf8D\x15\xc0\xdd\x02\xbf'

    def __init__(self, repo: 'Repo', binsha: bytes):
        """Initialize an object by identifying it by its binary sha.
        All keyword arguments will be set on demand if None.
    
        :param repo: repository this object is located in
    
        :param binsha: 20 byte SHA1"""
>       super(Object, self).__init__()

../../../Library/Caches/pypoetry/virtualenvs/arduino-cli-5LFazWvB-py3.9/lib/python3.9/site-packages/git/objects/base.py:56: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <[AttributeError('binsha') raised in repr()] Tree object at 0x105290950>
args = (), kwargs = {}

    def _no_init(self, *args, **kwargs):
>       raise TypeError('Protocols cannot be instantiated')
E       TypeError: Protocols cannot be instantiated

../../../hostedtoolcache/Python/3.9.7/x64/lib/python3.9/typing.py:1083: TypeError
=========================== short test summary info ============================
FAILED test/test_lib.py::test_install_git_invalid_library - TypeError: Protoc...
!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!! xdist.dsession.Interrupted: stopping after 1 failures !!!!!!!!!!!!!
============= 1 failed, 174 passed, 1 skipped in 784.80s (0:13:04) =============

Upstream bug report:
https://bugs.python.org/issue45121

  • What is the new behavior?

As a workaround, the Python version used by the "Test Integration" CI workflow that runs the integration tests is pinned to the last working version: 3.9.6.

No breaking change.

  • Other information:

Since it is convenient to get automatic updates for Python patch releases, this full pin should be reverted back to the "3.9" minor version pin once a new version of Python is released with the bug fixed and added to versions available for installation via the actions/setup-python GitHub Actions action.

…orkflow

A bug introduced in the 3.9.7 release of Python causes a spurious failure of the
`test\test_lib.py::test_install_git_invalid_library` integration test:
https://bugs.python.org/issue45121

As a workaround, the Python version used by the "Test Integration" CI workflow that runs the integration tests is pinned
to the last working version: 3.9.6. Since it is convenient to get automatic updates for Python patch releases, this full
pin should be reverted back to the "3.9" minor version pin once a new version of Python is released with the bug fixed
and added to versions available for installation via the `actions/setup-python` GitHub Actions action.
@per1234 per1234 added type: bug topic: infrastructure Related to project infrastructure labels Sep 10, 2021
@per1234 per1234 merged commit 7d7ade9 into arduino:master Sep 10, 2021
@per1234 per1234 deleted the pin-python branch September 16, 2021 12:52
@rsora rsora added the type: imperfection Perceived defect in any part of project label Sep 22, 2021
silvanocerza pushed a commit that referenced this pull request Sep 24, 2021
…orkflow (#1442)

A bug introduced in the 3.9.7 release of Python causes a spurious failure of the
`test\test_lib.py::test_install_git_invalid_library` integration test:
https://bugs.python.org/issue45121

As a workaround, the Python version used by the "Test Integration" CI workflow that runs the integration tests is pinned
to the last working version: 3.9.6. Since it is convenient to get automatic updates for Python patch releases, this full
pin should be reverted back to the "3.9" minor version pin once a new version of Python is released with the bug fixed
and added to versions available for installation via the `actions/setup-python` GitHub Actions action.
@per1234 per1234 self-assigned this Nov 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: infrastructure Related to project infrastructure type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants