8000 Fix running LS for tests in the new in_memory_localstack plugin by dfangl · Pull Request #9150 · localstack/localstack · GitHub
[go: up one dir, main page]

Skip to content

Fix running LS for tests in the new in_memory_localstack plugin #9150

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 2 commits into from
Sep 14, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion localstack/testing/pytest/in_memory_localstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ def pytest_addoption(parser: Parser, pluginmanager: PytestPluginManager):


@pytest.hookimpl(tryfirst=True)
def pytest_sessionstart(session: Session):
def pytest_runtestloop(session: Session):
if not session.config.option.start_localstack:
LOG.info("Configuration option to start LocalStack not set.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: should we maybe invert the info, i.e., only log IF it is set? otherwise you'll see this every time you run unit,cli, or bootstrap tests, and that may be a bit misleading.

Copy link
Member Author
@dfangl dfangl Sep 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason this log was introduced, was that I had a hard time to debug why LS was not starting. In our case, because the config option was not set, but it could also have been that the plugin was not picked up, or some other reason.
If LocalStack would try to start, we should see that in the log anyway. However I see the issue with other tests.

What about a message like "LocalStack was not configured to start for this test suite"? Would that be less misleading?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed in slack, and agreed upon a message on module load, to log the plugin load.

return

from localstack.testing.aws.util import is_aws_cloud
Expand Down
0