Skip to content

Commit

Permalink
Update test settings with new values
Browse files Browse the repository at this point in the history
Remove Int max value as its not required
  • Loading branch information
QU3B1M committed Dec 18, 2024
1 parent f81bd90 commit 376f8de
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 16 deletions.
19 changes: 16 additions & 3 deletions plugins/command-manager/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,24 @@ testClusters.integTest {
jvmArgs '-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5005'
}

setting 'm_api.auth.username', 'admin'
setting 'm_api.auth.password', 'test'
setting 'm_api.uri', 'https://127.0.0.1:55000' // base URI of the M_API
setting 'management_api.auth.username', 'admin'
setting 'management_api.auth.password', 'test'
setting 'management_api.host', 'https://127.0.0.1:55000' // base URI of the Management API
setting 'management_api.retries', '3'
setting 'management_api.timeout', '30'
setting 'command_manager.timeout', '30'
setting 'command_manager.job.schedule', '60'
setting 'command_manager.job.page_size', '100'
setting 'command_manager.job.pit_keep_alive', '10'
setting 'command_manager.job.index.name', 'job_index'
setting 'command_manager.job.index.template', 'job_template'
setting 'command_manager.api.prefix', '/api'
setting 'command_manager.api.endpoint', 'endpoint'
setting 'command_manager.index.name', 'index_name'
setting 'command_manager.index.template', 'index_template'
}


run {
useCluster testClusters.integTest
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,20 @@ public List<Setting<?>> getSettings() {
// Register API settings
PluginSettings.M_API_AUTH_USERNAME,
PluginSettings.M_API_AUTH_PASSWORD,
PluginSettings.M_API_URI);
PluginSettings.M_API_URI,
PluginSettings.M_API_RETRIES,
PluginSettings.M_API_TIMEOUT,
PluginSettings.C_M_TIMEOUT,
PluginSettings.C_M_JOB_SCHEDULE,
PluginSettings.C_M_JOB_PAGE_SIZE,
PluginSettings.C_M_JOB_KEEP_ALIVE,
PluginSettings.C_M_JOB_INDEX_NAME,
PluginSettings.C_M_JOB_INDEX_TEMPLATE,
PluginSettings.C_M_API_PREFIX,
PluginSettings.C_M_API_ENDPOINT,
PluginSettings.C_M_INDEX_NAME,
PluginSettings.C_M_INDEX_TEMPLATE
);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ public class PluginSettings {
// Management API settings
public static final Setting<String> M_API_URI = Setting.simpleString(
M_API_PREFIX + ".host", Setting.Property.NodeScope, Setting.Property.Filtered);
public static final Setting<String> M_API_RETRIES = Setting.simpleString(
M_API_PREFIX + ".retries", Setting.Property.NodeScope, Setting.Property.Filtered);
public static final Setting<Integer> M_API_RETRIES = Setting.intSetting(
M_API_PREFIX + ".retries", Integer.MIN_VALUE, Setting.Property.NodeScope, Setting.Property.Filtered);
public static final Setting<Integer> M_API_TIMEOUT = Setting.intSetting(
M_API_PREFIX + ".timeout", Integer.MIN_VALUE, Integer.MAX_VALUE, Setting.Property.NodeScope, Setting.Property.Filtered);
M_API_PREFIX + ".timeout", Integer.MIN_VALUE, Setting.Property.NodeScope, Setting.Property.Filtered);

// Management API Auth settings
public static final Setting<String> M_API_AUTH_USERNAME = Setting.simpleString(
Expand All @@ -48,18 +48,16 @@ public class PluginSettings {
M_API_PREFIX + ".auth.password", Setting.Property.NodeScope, Setting.Property.Filtered);

// Command Manager settings
public static final Setting<String> C_M_LOGGING = Setting.simpleString(
C_M_PREFIX + ".logging", Setting.Property.NodeScope, Setting.Property.Filtered);
public static final Setting<Integer> C_M_TIMEOUT = Setting.intSetting(
C_M_PREFIX + ".timeout", Integer.MIN_VALUE, Integer.MAX_VALUE, Setting.Property.NodeScope, Setting.Property.Filtered);
C_M_PREFIX + ".timeout", Integer.MIN_VALUE, Setting.Property.NodeScope, Setting.Property.Filtered);

// Command Manager Job settings
public static final Setting<String> C_M_JOB_SCHEDULE = Setting.simpleString(
C_M_PREFIX + ".job.schedule", Setting.Property.NodeScope, Setting.Property.Filtered);
public static final Setting<Integer> C_M_JOB_PAGE_SIZE = Setting.intSetting(
C_M_PREFIX + ".job.page_size", Integer.MIN_VALUE, Integer.MAX_VALUE, Setting.Property.NodeScope, Setting.Property.Filtered);
C_M_PREFIX + ".job.page_size", Integer.MIN_VALUE, Setting.Property.NodeScope, Setting.Property.Filtered);
public static final Setting<Integer> C_M_JOB_KEEP_ALIVE = Setting.intSetting(
C_M_PREFIX + ".job.pit_keep_alive", Integer.MIN_VALUE, Integer.MAX_VALUE, Setting.Property.NodeScope, Setting.Property.Filtered);
C_M_PREFIX + ".job.pit_keep_alive", Integer.MIN_VALUE, Setting.Property.NodeScope, Setting.Property.Filtered);
public static final Setting<String> C_M_JOB_INDEX_NAME = Setting.simpleString(
C_M_PREFIX + ".job.index.name", Setting.Property.NodeScope, Setting.Property.Filtered);
public static final Setting<String> C_M_JOB_INDEX_TEMPLATE = Setting.simpleString(
Expand All @@ -83,8 +81,8 @@ public class PluginSettings {
private final String authPassword;
private final String uri;
public final int retries;
public final int apiTimeout;
public final int timeout;
public final String logging;
public final String jobSchedule;
public final int jobPageSize;
public final int jobKeepAlive;
Expand All @@ -104,9 +102,9 @@ private PluginSettings(@NonNull final Settings settings) {
this.authUsername = M_API_AUTH_USERNAME.get(settings);
this.authPassword = M_API_AUTH_PASSWORD.get(settings);
this.uri = M_API_URI.get(settings);
this.retries = Integer.parseInt(M_API_RETRIES.get(settings));
this.retries = M_API_RETRIES.get(settings);
this.apiTimeout = M_API_TIMEOUT.get(settings);
this.timeout = M_API_TIMEOUT.get(settings);
this.logging = C_M_LOGGING.get(settings);
this.jobSchedule = C_M_JOB_SCHEDULE.get(settings);
this.jobPageSize = C_M_JOB_PAGE_SIZE.get(settings);
this.jobKeepAlive = C_M_JOB_KEEP_ALIVE.get(settings);
Expand All @@ -121,7 +119,6 @@ private PluginSettings(@NonNull final Settings settings) {
log.info("[SETTINGS] URI: {}", this.uri);
log.info("[SETTINGS] Retries: {}", this.retries);
log.info("[SETTINGS] Timeout: {}", this.timeout);
log.info("[SETTINGS] Logging: {}", this.logging);

log.info("[SETTINGS] jobSchedule: {}", jobSchedule);
log.info("[SETTINGS] jobPageSize: {}", jobPageSize);
Expand Down

0 comments on commit 376f8de

Please sign in to comment.