Skip to content

Commit

Permalink
CDK itests refactoring
Browse files Browse the repository at this point in the history
	- added 120 second treshold for each server adapter start operation - CDK-216
	- finished adding of mocking files
	- discovery itests repaired
	- discovery itests refactored to run faster at the expense of test separation
	- removed deprecated tests - cdk 2.x itests removed from suites
	- added wait condition to accept dfferent problem dialogs during cdk start up
	- added skipping of cdk rhel image registration
	- added test case with verification of cdk rhel image registration

Signed-off-by: Ondrej Dockal <odockal@redhat.com>
  • Loading branch information
odockal committed Jan 17, 2018
1 parent 1b9a63c commit 8194a90
Show file tree
Hide file tree
Showing 39 changed files with 731 additions and 478 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
echo "minishift v1.3.1+a2d3799"
echo "CDK v3.1.1-1"
echo minishift v1.3.1+a2d3799
echo CDK v3.1.1-1
exit 0

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
echo "minishift v1.7.0+204ce19"
echo "CDK v3.2.0-1"
echo minishift v1.7.0+204ce19
echo CDK v3.2.0-1
exit 0

Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
package org.jboss.tools.cdk.ui.bot.test;

import org.eclipse.reddeer.junit.runner.RedDeerSuite;
import org.jboss.tools.cdk.ui.bot.test.server.adapter.CDK32ServerAdapterConnectionTest;
import org.jboss.tools.cdk.ui.bot.test.server.adapter.CDK32ServerAdapterRestartTest;
import org.jboss.tools.cdk.ui.bot.test.server.adapter.CDK32ServerAdapterStartTest;
import org.jboss.tools.cdk.ui.bot.test.server.adapter.CDK32IntegrationTest;
import org.jboss.tools.cdk.ui.bot.test.server.adapter.openshift.CDKImageRegistryUrlDiscoveryFailureTest;
import org.jboss.tools.cdk.ui.bot.test.server.adapter.openshift.CDKImageRegistryUrlDiscoveryTest;
import org.jboss.tools.cdk.ui.bot.test.server.adapter.openshift.CDKImageRegistryUrlValidatorTest;
import org.jboss.tools.cdk.ui.bot.test.server.editor.CDK32ServerEditorTest;
import org.jboss.tools.cdk.ui.bot.test.server.editor.launch.CDKLaunchConfigurationTest;
import org.jboss.tools.cdk.ui.bot.test.server.wizard.CDK32ServerWizardTest;
Expand All @@ -26,10 +26,10 @@
CDK32ServerWizardTest.class,
CDK32ServerEditorTest.class,
CDKLaunchConfigurationTest.class,
CDKImageRegistryUrlValidatorTest.class,
CDKImageRegistryUrlDiscoveryFailureTest.class,
CDKImageRegistryUrlDiscoveryTest.class,
CDK32ServerAdapterStartTest.class,
CDK32ServerAdapterRestartTest.class,
CDK32ServerAdapterConnectionTest.class
CDK32IntegrationTest.class
})
/**
* @author ondrej dockal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,19 @@ public abstract class CDKAbstractTest {
public static void checkMinishiftParameters() {
Map<String, String> dict = new HashMap<>();
dict.put("Minishift path", MINISHIFT);
dict.put("Minishift hypervisor", MINISHIFT_HYPERVISOR == null ? "" : MINISHIFT_HYPERVISOR);
CDKTestUtils.checkParameterNotNull(dict);
checkMinishiftHypervisorParameters();
}

public static void checkMinishiftProfileParameters() {
Map<String, String> dict = new HashMap<>();
dict.put("Minishift profile path", MINISHIFT_PROFILE);
CDKTestUtils.checkParameterNotNull(dict);
checkMinishiftHypervisorParameters();
}

public static void checkMinishiftHypervisorParameters() {
Map<String, String> dict = new HashMap<>();
dict.put("Minishift hypervisor", MINISHIFT_HYPERVISOR == null ? "" : MINISHIFT_HYPERVISOR);
CDKTestUtils.checkParameterNotNull(dict);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,29 @@
package org.jboss.tools.cdk.ui.bot.test;

import org.eclipse.reddeer.junit.runner.RedDeerSuite;
import org.jboss.tools.cdk.ui.bot.test.server.adapter.CDK32ServerAdapterConnectionTest;
import org.jboss.tools.cdk.ui.bot.test.server.adapter.CDK32ServerAdapterRestartTest;
import org.jboss.tools.cdk.ui.bot.test.server.adapter.CDK32ServerAdapterStartTest;
import org.jboss.tools.cdk.ui.bot.test.server.adapter.CDK32IntegrationTest;
import org.jboss.tools.cdk.ui.bot.test.server.adapter.openshift.CDKImageRegistryUrlDiscoveryFailureTest;
import org.jboss.tools.cdk.ui.bot.test.server.adapter.openshift.CDKImageRegistryUrlDiscoveryTest;
import org.jboss.tools.cdk.ui.bot.test.server.adapter.openshift.CDKImageRegistryUrlValidatorTest;
import org.jboss.tools.cdk.ui.bot.test.server.editor.CDK32ServerEditorTest;
import org.jboss.tools.cdk.ui.bot.test.server.editor.CDK3ServerEditorTest;
import org.jboss.tools.cdk.ui.bot.test.server.editor.CDKServerEditorTest;
import org.jboss.tools.cdk.ui.bot.test.server.editor.launch.CDKLaunchConfigurationTest;
import org.jboss.tools.cdk.ui.bot.test.server.wizard.CDK32ServerWizardTest;
import org.jboss.tools.cdk.ui.bot.test.server.wizard.CDK3ServerWizardTest;
import org.jboss.tools.cdk.ui.bot.test.server.wizard.CDKServerWizardTest;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;

@RunWith(RedDeerSuite.class)
@Suite.SuiteClasses({
CDKServerWizardTest.class,
CDK3ServerWizardTest.class,
CDK32ServerWizardTest.class,
CDKServerEditorTest.class,
CDK3ServerEditorTest.class,
CDK32ServerEditorTest.class,
CDKLaunchConfigurationTest.class,
CDKImageRegistryUrlDiscoveryTest.class,
CDKImageRegistryUrlDiscoveryFailureTest.class,
CDKImageRegistryUrlValidatorTest.class,
CDK32ServerAdapterStartTest.class,
CDK32ServerAdapterRestartTest.class,
CDK32ServerAdapterConnectionTest.class
CDK32IntegrationTest.class
})
/**
* @author ondrej dockal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,22 @@
import org.eclipse.reddeer.junit.runner.RedDeerSuite;
import org.jboss.tools.cdk.ui.bot.test.server.adapter.CDK32IntegrationTest;
import org.jboss.tools.cdk.ui.bot.test.server.adapter.openshift.CDKImageRegistryUrlDiscoveryTest;
import org.jboss.tools.cdk.ui.bot.test.server.adapter.openshift.CDKImageRegistryUrlValidatorTest;
import org.jboss.tools.cdk.ui.bot.test.server.editor.CDK32ServerEditorTest;
import org.jboss.tools.cdk.ui.bot.test.server.editor.CDK3ServerEditorTest;
import org.jboss.tools.cdk.ui.bot.test.server.editor.CDKServerEditorTest;
import org.jboss.tools.cdk.ui.bot.test.server.editor.launch.CDKLaunchConfigurationTest;
import org.jboss.tools.cdk.ui.bot.test.server.wizard.CDK32ServerWizardTest;
import org.jboss.tools.cdk.ui.bot.test.server.wizard.CDK3ServerWizardTest;
import org.jboss.tools.cdk.ui.bot.test.server.wizard.CDKServerWizardTest;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;

@RunWith(RedDeerSuite.class)
@Suite.SuiteClasses({
CDKServerWizardTest.class,
CDK3ServerWizardTest.class,
CDK32ServerWizardTest.class,
CDKServerEditorTest.class,
CDK3ServerEditorTest.class,
CDK32ServerEditorTest.class,
CDKLaunchConfigurationTest.class,
CDKImageRegistryUrlValidatorTest.class,
CDKImageRegistryUrlDiscoveryTest.class,
//CDK3IntegrationTest.class,
CDK32IntegrationTest.class
})
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,19 @@
******************************************************************************/
package org.jboss.tools.cdk.ui.bot.test.server.adapter;

import static org.junit.Assert.assertEquals;

import org.eclipse.reddeer.eclipse.wst.server.ui.cnf.ServersViewEnums.ServerState;
import org.eclipse.reddeer.junit.runner.RedDeerSuite;
import org.jboss.tools.openshift.reddeer.requirement.CleanOpenShiftExplorerRequirement.CleanOpenShiftExplorer;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;

/**
* Testing of CDK 3.2+ server adapter
* @author odockal
*
*/
@CleanOpenShiftExplorer
@RunWith(RedDeerSuite.class)
public class CDK32IntegrationTest extends CDKServerAdapterAbstractTest {

private static final String DOCKER_DAEMON_CONNECTION = "Container Development Environment 3.2";
Expand All @@ -39,21 +41,24 @@ public static void setup() {
}

@Test
public void testCDK3ServerAdapter() {
public void testCDK32ServerAdapter() {
// cdk start verification
startServerAdapter();
startServerAdapter(() -> {});
// cdk inner rhel image was registered during starting of server adapter
verifyConsoleContainsRegEx("\\bRegistering.*subscription-manager\\b");
verifyConsoleContainsRegEx("\\bRegistration in progress.*OK\\b");
// OS3 and docker connection created verification
testOpenshiftConncetion(findOpenShiftConnection(null, OPENSHIFT_USERNAME));
testDockerConnection(DOCKER_DAEMON_CONNECTION);
// cdk restart check
getCDEServer().restart();
assertEquals(ServerState.STARTED, getCDEServer().getLabel().getState());
restartServerAdapter();
// OS and docker connection should be operational after restart
testOpenshiftConncetion(findOpenShiftConnection(null, OPENSHIFT_USERNAME));
testDockerConnection(DOCKER_DAEMON_CONNECTION);
// cdk stop verification
getCDEServer().stop();
assertEquals(ServerState.STOPPED, getCDEServer().getLabel().getState());
stopServerAdapter();
// verify unregistering of machine
verifyConsoleContainsRegEx("\\bUnregistering machine\\b");
}

}

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,17 @@ public static void setup() {

@Test
public void testCDK3ServerAdapter() {
startServerAdapter();
// cdk start verification
startServerAdapter(() -> skipRegistration(getCDEServer()));
// OS3 and docker connection created verification
testOpenshiftConncetion(findOpenShiftConnection(null, OPENSHIFT_USERNAME));
testDockerConnection(DOCKER_DAEMON_CONNECTION);
// cdk restart check
restartServerAdapter();
// OS and docker connection should be operational after restart
testOpenshiftConncetion(findOpenShiftConnection(null, OPENSHIFT_USERNAME));
testDockerConnection(DOCKER_DAEMON_CONNECTION);
// cdk stop verification
stopServerAdapter();
}
}

0 comments on commit 8194a90

Please sign in to comment.