new-integration-tests/src/test/java/oracle/weblogic/kubernetes/utils/CommonTestUtils.java
public static HelmParams installAndVerifyGrafana(String grafanaReleaseName,
                                                   String grafanaNamespace,
                                                   String grafanaValueFile,
                                                   String grafanaVersion,
                                                   int grafanaNodePort) {
    LoggingFacade logger = getLogger();
    // Helm install parameters
    HelmParams grafanaHelmParams = new HelmParams()
        .releaseName(grafanaReleaseName)
        .namespace(grafanaNamespace)
        .chartDir("stable/grafana")
        .chartValuesFile(grafanaValueFile);

    if (grafanaVersion != null) {
      grafanaHelmParams.chartVersion(grafanaVersion);
    }

    // grafana chart values to override
    GrafanaParams grafanaParams = new GrafanaParams()
        .helmParams(grafanaHelmParams)
        .nodePort(grafanaNodePort);
    //create grafana secret
    createSecretWithUsernamePassword("grafana-secret", grafanaNamespace, "admin", "12345678");
    // install grafana
    logger.info("Installing grafana in namespace {0}", grafanaNamespace);
    assertTrue(installGrafana(grafanaParams),
        String.format("Failed to install grafana in namespace %s", grafanaNamespace));
    logger.info("Grafana installed in namespace {0}", grafanaNamespace);

    // list Helm releases matching grafana release name in  namespace
    logger.info("Checking grafana release {0} status in namespace {1}",
        grafanaReleaseName, grafanaNamespace);
    assertTrue(isHelmReleaseDeployed(grafanaReleaseName, grafanaNamespace),
        String.format("Grafana release %s is not in deployed status in namespace %s",
            grafanaReleaseName, grafanaNamespace));
    logger.info("Grafana release {0} status is deployed in namespace {1}",
        grafanaReleaseName, grafanaNamespace);

    // wait for the grafana pod to be ready
    logger.info("Wait for the grafana pod is ready in namespace {0}", grafanaNamespace);
    withStandardRetryPolicy
        .conditionEvaluationListener(
            condition -> logger.info("Waiting for grafana to be running in namespace {0} "
                    + "(elapsed time {1}ms, remaining time {2}ms)",
                grafanaNamespace,
                condition.getElapsedTimeInMS(),
                condition.getRemainingTimeInMS()))
        .until(assertDoesNotThrow(() -> isGrafanaReady(grafanaNamespace),
            "grafanaIsReady failed with ApiException"));

    return grafanaHelmParams;
  }
/**
   * Install Grafana and wait up to five minutes until the grafana pod is ready.
   *
   * @param grafanaReleaseName the grafana release name
   * @param grafanaNamespace the grafana namespace in which the operator will be installed
   * @param grafanaValueFile the grafana value.yaml file path
   * @param grafanaVersion the version of the grafana helm chart
   * @param grafanaNodePort nodePort value for grafana server
   * @return the grafana Helm installation parameters
   */
Install Grafana and wait up to five minutes until the grafana pod is ready.
Install Grafana and wait up to five minutes until the grafana pod is ready .
public static HelmParams installAndVerifyGrafana(String grafanaReleaseName,
                                                   String grafanaNamespace,
                                                   String grafanaValueFile,
                                                   String grafanaVersion,
                                                   int grafanaNodePort) {
    LoggingFacade logger = getLogger();
    HelmParams grafanaHelmParams = new HelmParams()
        .releaseName(grafanaReleaseName)
        .namespace(grafanaNamespace)
        .chartDir("stable/grafana")
        .chartValuesFile(grafanaValueFile);
    if (grafanaVersion != null) {
      grafanaHelmParams.chartVersion(grafanaVersion);
    }
    GrafanaParams grafanaParams = new GrafanaParams()
        .helmParams(grafanaHelmParams)
        .nodePort(grafanaNodePort);
    createSecretWithUsernamePassword("grafana-secret", grafanaNamespace, "admin", "12345678");
    logger.info("Installing grafana in namespace {0}", grafanaNamespace);
    assertTrue(installGrafana(grafanaParams),
        String.format("Failed to install grafana in namespace %s", grafanaNamespace));
    logger.info("Grafana installed in namespace {0}", grafanaNamespace);
    logger.info("Checking grafana release {0} status in namespace {1}",
        grafanaReleaseName, grafanaNamespace);
    assertTrue(isHelmReleaseDeployed(grafanaReleaseName, grafanaNamespace),
        String.format("Grafana release %s is not in deployed status in namespace %s",
            grafanaReleaseName, grafanaNamespace));
    logger.info("Grafana release {0} status is deployed in namespace {1}",
        grafanaReleaseName, grafanaNamespace);
    logger.info("Wait for the grafana pod is ready in namespace {0}", grafanaNamespace);
    withStandardRetryPolicy
        .conditionEvaluationListener(
            condition -> logger.info("Waiting for grafana to be running in namespace {0} "
                    + "(elapsed time {1}ms, remaining time {2}ms)",
                grafanaNamespace,
                condition.getElapsedTimeInMS(),
                condition.getRemainingTimeInMS()))
        .until(assertDoesNotThrow(() -> isGrafanaReady(grafanaNamespace),
            "grafanaIsReady failed with ApiException"));
    return grafanaHelmParams;
  }
public static HelmParams installAndVerifyGrafana ( String grafanaReleaseName , String grafanaNamespace , String grafanaValueFile , String grafanaVersion , int grafanaNodePort ) { LoggingFacade logger = getLogger ( ) ; HelmParams grafanaHelmParams = new HelmParams ( ) . releaseName ( grafanaReleaseName ) . namespace ( grafanaNamespace ) . chartDir ( "stable/grafana" ) . chartValuesFile ( grafanaValueFile ) ; if ( grafanaVersion != null ) { grafanaHelmParams . chartVersion ( grafanaVersion ) ; } GrafanaParams grafanaParams = new GrafanaParams ( ) . helmParams ( grafanaHelmParams ) . nodePort ( grafanaNodePort ) ; createSecretWithUsernamePassword ( "grafana-secret" , grafanaNamespace , "admin" , "12345678" ) ; logger . info ( "Installing grafana in namespace {0}" , grafanaNamespace ) ; assertTrue ( installGrafana ( grafanaParams ) , String . format ( "Failed to install grafana in namespace %s" , grafanaNamespace ) ) ; logger . info ( "Grafana installed in namespace {0}" , grafanaNamespace ) ; logger . info ( "Checking grafana release {0} status in namespace {1}" , grafanaReleaseName , grafanaNamespace ) ; assertTrue ( isHelmReleaseDeployed ( grafanaReleaseName , grafanaNamespace ) , String . format ( "Grafana release %s is not in deployed status in namespace %s" , grafanaReleaseName , grafanaNamespace ) ) ; logger . info ( "Grafana release {0} status is deployed in namespace {1}" , grafanaReleaseName , grafanaNamespace ) ; logger . info ( "Wait for the grafana pod is ready in namespace {0}" , grafanaNamespace ) ; withStandardRetryPolicy . conditionEvaluationListener ( condition -> logger . info ( "Waiting for grafana to be running in namespace {0} " + "(elapsed time {1}ms, remaining time {2}ms)" , grafanaNamespace , condition . getElapsedTimeInMS ( ) , condition . getRemainingTimeInMS ( ) ) ) . until ( assertDoesNotThrow ( ( ) -> isGrafanaReady ( grafanaNamespace ) , "grafanaIsReady failed with ApiException" ) ) ; return grafanaHelmParams ; }
Install Grafana and wait up to five minutes until the grafana pod is ready.
Install Grafana and wait up to five minutes until the grafana pod is ready .
// Helm install parameters // grafana chart values to override //create grafana secret // install grafana // list Helm releases matching grafana release name in  namespace // wait for the grafana pod to be ready