Skip to content
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

Port for database instance is not updated #147

Closed
androa opened this issue Jul 18, 2023 · 7 comments · Fixed by #156
Closed

Port for database instance is not updated #147

androa opened this issue Jul 18, 2023 · 7 comments · Fixed by #156

Comments

@androa
Copy link

androa commented Jul 18, 2023

Describe the bug
The port does not get updated. The notification is not popping up either.

I've tried to figure out why and I can't understand anything else than that the IntelliJ ConsoleFilterProvider or the getMaybeLocalDataSource() is not firing correctly.

To Reproduce
I run my tests which outputs this to the logs:
{"@timestamp":"2023-07-18T16:13:11.315968+02:00","@version":"1","message":"Database: jdbc:postgresql://localhost:32799/test (PostgreSQL 15.2)","logger_name":"org.flywaydb.core.internal.database.base.BaseDatabaseType","thread_name":"Test worker","level":"INFO","level_value":20000}

My datasource in IntelliJ is configured with this URL: jdbc:postgresql://localhost:32791/test.

Expected behavior
The port to be updated.

Screenshots
Screenshot 2023-07-18 at 16 21 07
Screenshot 2023-07-18 at 16 21 38
Screenshot 2023-07-18 at 16 22 15

IntelliJ version

IntelliJ IDEA 2023.1.4 (Ultimate Edition)
Build #IU-231.9225.16, built on July 12, 2023
Runtime version: 17.0.7+10-b829.16 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 13.4.1

Kotlin: 231-1.8.21-IJ9225.16
@yusufugurozbek
Copy link
Owner

Hello @androa 👋🏼

Thanks for using the plugin and reporting the issue. I'll take a look when I have time.

Greetings 🖐🏼

@yusufugurozbek
Copy link
Owner

yusufugurozbek commented Jul 22, 2023

Howdy @androa 🖐🏼

I assume you have a custom logging configuration to have JSON logs. Could you please share it with me? I need to reproduce that on my local machine.

Even for better help, you may create a merge request on https://github.com/yusufugurozbek/testcontainers-demo with your configuration.

Greetings

androa added a commit to androa/testcontainers-demo that referenced this issue Aug 3, 2023
This replicates the test setup for the issue yusufugurozbek/testcontainers-port-updater#147
@androa
Copy link
Author

androa commented Aug 3, 2023

Yep, that's right. This is the log configuration we run: https://github.com/navikt/rapids-and-rivers/blob/master/src/main/resources/logback.xml. Added a PR to your demo-repository with that (slightly simplified) setup.

Testing with and without JSON-formatting, it is clearly the culprit.

The plugin has worked marvels with this configuration for years.

@yusufugurozbek yusufugurozbek linked a pull request Aug 18, 2023 that will close this issue
@yusufugurozbek
Copy link
Owner

yusufugurozbek commented Aug 18, 2023

The new release (v1.1.2) should solve your issue. Please check the settings and mark your project logging format as JSON. Looking forward to hearing your feedback.

@androa
Copy link
Author

androa commented Aug 28, 2023

Thank you! Tested it now and it seems to work now. But I'm not getting any notifications, even if it is checked off in the settings.

@yusufugurozbek
Copy link
Owner

yusufugurozbek commented Aug 28, 2023

I checked that and the notifications are working fine for me. My recommendations are:

  • You already checked the Testcontainers Port Updater notifications are enabled. You can skip this step.
  • Checking the notifications for Testcontainers Port Updater. That should be Balloon
image

Greetings 👋🏼

@androa
Copy link
Author

androa commented Aug 28, 2023

It was indeed the notification settings that was set to no popup. This seems to be the default when the plugin is installed. Thank you again. This plugin is one of the most time saving plugins out there 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants