Closed ehmatthes closed 1 day ago
[ ] When running Platform.sh e2e tests, if the CLI is not authenticated the test hangs on the first run. A subsequent run catches the not authenticated error message. Not obvious to troubleshoot quickly, because it's only some runs that hang. Problem likely in platform_sh/tests/e2e_tests/utils.py
:
def check_logged_in():
"""Check that user is currently logged in to Platform.sh through CLI."""
print("\nVerifying logged in to Platform.sh CLI...")
auth_info_output = make_sp_call("platform auth:info --quiet", capture_output=True)
if "LoginRequiredException" in auth_info_output.stderr.decode():
msg = "\n----- Error: Not logged in through CLI -----"
msg += "\nPlease log in to the Platform.sh CLI and then run the e2e test."
msg += "\n You can log in with the command: platform login"
msg += "\n-----\n"
print(msg)
exit_msg = "Please run `platform login` and then run e2e tests."
pytest.exit(exit_msg)
utils/sd_utils.py
and utils/plugin_utils.py
.utils.add_file()
should validate that either contents
is provided, or template
and context
are provided. Not all three.
I don't really like how many of the plugin_utils functions require the sd_command
argument. It's boilerplate, and not entirely clear. I'm accepting it for now because I like plugin utility functions much better than a set of methods on Command
that the plugin needs to call. I think it's better for plugin authors to read through a single module of functions they can use, than to have to look into the simple_deploy.py listing with all its internals.
plugin_utils.init()
function that register required resources such as sd_command.stdout
as a global. This is not ideal, with all the issues that globals bring about.plugin_utils.modify_settings_file()
, consider just accepting a string for the modified block. The template would be part of core, since it's the same across platforms?
plugin_utils.get_template_string()
for this (or any file!).sd_utils._get_plugin_name_from_packages()
. Can also parse available packages starting with dsd-
.e2e_tests.test_deployment
and e2e_tests.utils
, which could overlap with core.[ ] If there's any issue with plugin test collection because modifying config.args
is bad, go back to hard-coding default plugins in pytest.ini:
[pytest]
# This assumes that the default plugins exist in the same directory as django-simple-deploy.
testpaths =
# Core simple_deploy tests.
tests
# Tests for default plugins.
../dsd-flyio/tests/
../dsd-platformsh/tests/
../dsd-heroku/tests/
This is a holding place for issues that arise in working toward 1.0, but aren't worth a separate issue that will likely become stale for a while. If you want to work on one of these tasks, feel free to open a new issue dedicated to that task. I want to avoid having a large number of small issues open, making the project look less maintained than it is.