yorlov / testcontainers-port-updater

You are using Testcontainers and want to have your Testcontainers database accessible directly within IntelliJ? You are tired of changing the port configuration all the time since Testcontainers chooses a random port on each startup? This plugin solves your issue.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Testcontainers Port Updater

Build Version Downloads

You are using Testcontainers and want to have your Testcontainers database accessible directly within IntelliJ? You are tired of changing the port configuration all the time since Testcontainers chooses a random port on each startup? This plugin solves your issue.

It automatically updates the IntelliJ data source port number with the exposed random port number that Testcontainers chose on startup.

If you don't know what is Testcontainers, please check their official web page https://www.testcontainers.org/

Installation

  • Using IDE built-in plugin system:

    Settings/Preferences > Plugins > Marketplace > Search for "Testcontainers Port Updater" > Install Plugin

  • Manually:

    Download the latest release and install it manually using Settings/Preferences > Plugins > ⚙️ > Install plugin from disk...

Usage

For having a working plugin there are 2 requirements;

1- The plugin expects that Testcontainers writes a log that starts with Database:. If you don't see any logs on your console, please check your Testcontainers configurations and your log level.

Example log;

2021-06-23 14:07:26.408  INFO [your-service,,] 11111 --- [           main] o.f.c.i.database.base.DatabaseType       : Database: jdbc:postgresql://localhost:12345/test (PostgreSQL 10.13)

2- You need to add a new data source into your IntelliJ. For more details, please visit this page from IntelliJ.

After covering these 2 requirements, the plugin automatically will catch the log and update the matched data source URL with the Testcontainers' one.


Plugin based on the IntelliJ Platform Plugin Template.

About

You are using Testcontainers and want to have your Testcontainers database accessible directly within IntelliJ? You are tired of changing the port configuration all the time since Testcontainers chooses a random port on each startup? This plugin solves your issue.


Languages

Language:Kotlin 100.0%