mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 16:16:17 +02:00
do not load metrics in test
This commit is contained in:
parent
d82bd9b22c
commit
b0f32fdba2
2 changed files with 11 additions and 4 deletions
|
|
@ -7,6 +7,7 @@ import io.delilaheve.CustomAnvil
|
|||
import io.delilaheve.util.ConfigOptions
|
||||
import xyz.alexcrea.cuanvil.command.DiagnosticExecutor
|
||||
import xyz.alexcrea.cuanvil.config.ConfigHolder
|
||||
import xyz.alexcrea.cuanvil.dependency.DependencyManager
|
||||
|
||||
object MetricsUtil {
|
||||
|
||||
|
|
@ -17,6 +18,8 @@ object MetricsUtil {
|
|||
private var FAST_STATS_METRICS: BukkitContext? = null
|
||||
|
||||
fun loadMetrics(plugin: CustomAnvil) {
|
||||
if(DependencyManager.externGuiTester.isInTest()) return
|
||||
|
||||
val config = ConfigHolder.DEFAULT_CONFIG.config
|
||||
val metricString = config.getString(ConfigOptions.METRIC_TYPE, MetricType.AUTO.value)!!
|
||||
val metricType = MetricType.from(metricString)
|
||||
|
|
|
|||
|
|
@ -8,11 +8,15 @@ public class CustomAnvilTests extends DefaultCustomAnvilTest {
|
|||
|
||||
@Test
|
||||
public void simpleInitTest() {
|
||||
Assertions.assertNotNull(server);
|
||||
Assertions.assertNotNull(plugin);
|
||||
try {
|
||||
Assertions.assertNotNull(server);
|
||||
Assertions.assertNotNull(plugin);
|
||||
|
||||
// Test shutdown
|
||||
plugin.onDisable();
|
||||
// Test shutdown
|
||||
plugin.onDisable();
|
||||
} catch (Exception e) {
|
||||
Assertions.fail(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue