-
Notifications
You must be signed in to change notification settings - Fork 176
MSI: Integration tests #1133
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
MSI: Integration tests #1133
Conversation
5d3c3cd to
7073ba6
Compare
.github/workflows/main.yml
Outdated
|
|
||
| - name: Install Briefcase (editable) | ||
| run: | | ||
| pip install -e briefcase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still needed? Either way, this should only be installed for Windows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, I removed that
tests/test_examples.py
Outdated
| input_path = _example_path("register_envs") | ||
| for installer, install_dir in create_installer(input_path, tmp_path): | ||
| if installer.suffix == ".msi": | ||
| raise Exception("Test for 'register_envs' not yet implemented for MSI") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these exceptions be NotImplementedError?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, changed to NotImplementedError
26ee3bb to
a2caeec
Compare
4be5b94 to
6306743
Compare
6306743 to
ad8791d
Compare
constructor/briefcase.py
Outdated
| if "license_file" in info: | ||
| return {"file": info["license_file"]} | ||
| # We cannot return an empty string because that results in an exception on the briefcase side. | ||
| return {"text": "TODO"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do have a placeholder license: https://github.com/conda/constructor/blob/5eecfa0e8b9a46fa96bc19eb1cbf08a91a25fa52/constructor/nsis/placeholder_license.txt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, updated!
tests/test_examples.py
Outdated
| if is_admin(): | ||
| root_dir = Path(os.environ.get("PROGRAMFILES") or r"C:\Program Files") | ||
| else: | ||
| local_dir = os.environ.get("LOCALAPPDATA") or str(Path.home() / r"AppData\Local") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you using or instead of default values to account for empty strings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, updated to follow the convention we use with .get("FOO", <default>)
tests/test_examples.py
Outdated
| process = _execute(cmd, installer_input=installer_input, timeout=timeout, check=check) | ||
| except subprocess.CalledProcessError as e: | ||
| if log_path.exists(): | ||
| # When running on the CI system, it gets misdecodes a UTF-16 log file as UTF-8, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # When running on the CI system, it gets misdecodes a UTF-16 log file as UTF-8, | |
| # When running on the CI system, it tries to decode a UTF-16 log file as UTF-8, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
tests/test_examples.py
Outdated
| if request: # and ON_CI | ||
| # We always need to do this currently since uninstall doesnt work fully | ||
| request.addfinalizer(lambda: shutil.rmtree(str(install_dir), ignore_errors=True)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not add rmtree to _run_uninstaller_msi then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially I didn't want to the interface to *_uninstaller_msi and *_uninstaller_exe to differ, but since this is temporary I've updated it now, I agree it looks more concise this way.
tests/test_examples.py
Outdated
| if request: | ||
| request.addfinalizer( | ||
| lambda: shutil.rmtree(str(install_dir), ignore_errors=True) | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here - consider adding to _run_uninstaller_msi, especially since this is used in other tests later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
tests/test_examples.py
Outdated
| install_dir: Path, | ||
| timeout: int = 420, | ||
| check: bool = True, | ||
| request: bool = False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
request is not a boolean, but a FixtureRequest object: https://docs.pytest.org/en/stable/reference/reference.html#request
However, I would say that it's generally not needed as a finalizer. We can just add rmtree as a clean-up step until the uninstallation works well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh good that you caught that, I should not make assumptions based on an expression like if request:, I've updated it 496bf86, let me know if this is what you were thinking. I think this should be OK now, we always invoke rmtree, hopefully no test depended on rmtree not being called.
|
@marcoesters is it possible to restart the CLA/check that failed intermittently? |
36a1479
into
conda:briefcase-integration
Description
Opened this one separately, this branch and PR depends on #1084. No need to review this for now since the diff will look strange and is more for book-keeping since these changes were pulled out of PR 1084.
Checklist - did you ...
newsdirectory (using the template) for the next release's release notes?