Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
29 changes: 27 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.github.ktestify</groupId>
<artifactId>ktestify-parent</artifactId>
<version>1.0.2</version>
<version>1.0.3</version>
</parent>

<!-- Project Coordinates -->
Expand Down Expand Up @@ -56,7 +56,7 @@
<dependency>
<groupId>io.github.ktestify</groupId>
<artifactId>ktestify-core</artifactId>
<version>1.0.3</version>
<version>1.1.2</version>
</dependency>

<!-- ===================================== -->
Expand Down Expand Up @@ -122,6 +122,31 @@
<finalName>${project.build.finalName}</finalName>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>filter-plugin-version</id>
<goals>
<goal>copy-resources</goal>
</goals>
<phase>process-resources</phase>
<configuration>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/plugin-version.properties</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<!-- Surefire — unit tests (smaller heap than parent default) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import io.github.ktestify.notifications.config.NotificationsConfig;
import io.github.ktestify.plugin.KtestifyPlugin;
import io.github.ktestify.plugin.PluginContext;
import io.github.ktestify.plugin.PluginVersionResolver;
import lombok.extern.slf4j.Slf4j;

/**
Expand Down Expand Up @@ -65,8 +66,9 @@
@Slf4j
public class NotificationsPlugin implements KtestifyPlugin {

private static final String PLUGIN_VERSION = PluginVersionResolver.resolve(NotificationsPlugin.class, "dev");

private static final String PLUGIN_ID = "notifications";
private static final String VERSION = "1.0-SNAPSHOT";

@Override
public String getId() {
Expand All @@ -75,7 +77,7 @@ public String getId() {

@Override
public String getVersion() {
return VERSION;
return PLUGIN_VERSION;
}

@Override
Expand Down Expand Up @@ -111,28 +113,26 @@ public String getGluePackage() {
*/
@Override
public void initialize(PluginContext context) {
log.info("Initializing {} plugin v{}", getId(), getVersion());
log.info("Initializing plugin v{}", getVersion());

NotificationsConfig cfg = NotificationsConfig.from(context.getConfig().getRaw());

if (!cfg.isEnabled()) {
log.info("[{}] Notifications disabled. Set KTESTIFY_NOTIFICATIONS_ENABLED=true to activate.", getId());
log.info("Notifications disabled. Set KTESTIFY_NOTIFICATIONS_ENABLED=true to activate.");
return;
}

long enabledChannels = cfg.getEnabledChannels().size();
long groupCount = cfg.getGroups().size();

log.info(
"[{}] Plugin initialized, {} channel(s) active, {} tag group(s) configured, on-failure-only={}.",
getId(),
"Plugin initialized. Found {} channel(s) active, {} tag group(s) configured, on-failure-only={}.",
enabledChannels,
groupCount,
cfg.isOnFailureOnly());

cfg.getEnabledChannels()
.forEach(ch -> log.info(
"[{}] • channel: type={}, on-failure-only={}", getId(), ch.getType(), ch.isOnFailureOnly()));
.forEach(ch -> log.info(" channel: type={}, on-failure-only={}", ch.getType(), ch.isOnFailureOnly()));
}

/**
Expand All @@ -141,6 +141,6 @@ public void initialize(PluginContext context) {
*/
@Override
public void shutdown() {
log.debug("[{}] Plugin shut down.", getId());
log.debug("Plugin shut down.");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
plugin.version=${project.version}

Loading