diff --git a/tests/integration/README.md b/tests/integration/README.md new file mode 100644 index 00000000..0e498d3a --- /dev/null +++ b/tests/integration/README.md @@ -0,0 +1,4 @@ +The integration test framework is designed to be used to run tests against +an installed and working XDMoD instance. + +Run the tests with ./runtests.sh diff --git a/tests/integration/bootstrap.php b/tests/integration/bootstrap.php new file mode 100644 index 00000000..9536daa2 --- /dev/null +++ b/tests/integration/bootstrap.php @@ -0,0 +1,46 @@ + true ); - $this->xdmodhelper = new \TestHarness\XdmodTestHelper($xdmodConfig); + $this->xdmodhelper = new XdmodTestHelper($xdmodConfig); $this->endpoint = 'rest/v0.1/akrr/'; $this->xdmodhelper->authenticate("mgr"); @@ -20,8 +22,8 @@ private function validateAkrrResourceEntries($searchparams) $result = $this->xdmodhelper->get($this->endpoint . 'resources', $searchparams); $this->assertEquals(200, $result[1]['http_code']); - $this->assertArrayHasKey('success', $result[0]); - $this->assertEquals($result[0]['success'], true); + $this->assertArrayHasKey('status', $result[0]); + $this->assertEquals($result[0]['status'], 'success'); $data = $result[0]['data']; foreach ($data as $item) { @@ -45,15 +47,15 @@ private function validateAkrrKernelEntries($searchparams) $result = $this->xdmodhelper->get($this->endpoint . 'kernels', $searchparams); $this->assertEquals(200, $result[1]['http_code']); - $this->assertArrayHasKey('message', $result[0]); - $this->assertEquals($result[0]['message'], 'success'); + $this->assertArrayHasKey('status', $result[0]); + $this->assertEquals($result[0]['status'], 'success'); $data = $result[0]['data']; foreach ($data as $item) { - $this->assertArrayHasKey('nodes_list', $data[0]); - $this->assertArrayHasKey('name', $data[0]); - $this->assertArrayHasKey('enabled', $data[0]); - $this->assertArrayHasKey('id', $data[0]); + $this->assertArrayHasKey('nodes_list', $item); + $this->assertArrayHasKey('name', $item); + $this->assertArrayHasKey('enabled', $item); + $this->assertArrayHasKey('id', $item); } return $data; diff --git a/tests/integration_tests/phpunit.xml.dist b/tests/integration/phpunit.xml.dist similarity index 93% rename from tests/integration_tests/phpunit.xml.dist rename to tests/integration/phpunit.xml.dist index 578d81b6..50b04a1a 100644 --- a/tests/integration_tests/phpunit.xml.dist +++ b/tests/integration/phpunit.xml.dist @@ -10,7 +10,6 @@ convertWarningsToExceptions="true" forceCoversAnnotation="false" mapTestClassNameToCoveredClassName="false" - printerClass="PHPUnit_TextUI_ResultPrinter" processIsolation="false" stopOnError="false" stopOnFailure="false" diff --git a/tests/integration_tests/runtests.sh b/tests/integration/runtests.sh similarity index 100% rename from tests/integration_tests/runtests.sh rename to tests/integration/runtests.sh diff --git a/tests/integration_tests/scripts/bootstrap.sh b/tests/integration/scripts/bootstrap.sh similarity index 100% rename from tests/integration_tests/scripts/bootstrap.sh rename to tests/integration/scripts/bootstrap.sh diff --git a/tests/integration_tests/scripts/validate.sh b/tests/integration/scripts/validate.sh similarity index 100% rename from tests/integration_tests/scripts/validate.sh rename to tests/integration/scripts/validate.sh diff --git a/tests/integration_tests/README.md b/tests/integration_tests/README.md deleted file mode 100644 index 8ea333d7..00000000 --- a/tests/integration_tests/README.md +++ /dev/null @@ -1,7 +0,0 @@ -The integration test framework is designed to be used to run tests against -an installed and working XDMoD instance. - -The test harness in the xdmod repository must be configured correctly as -per the instructions in the readme file: xdmod/open_xdmod/modules/xdmod/integration_tests/README.md - -Run the tests with ./runtests.sh diff --git a/tests/integration_tests/bootstrap.php b/tests/integration_tests/bootstrap.php deleted file mode 100644 index 7e09b614..00000000 --- a/tests/integration_tests/bootstrap.php +++ /dev/null @@ -1,20 +0,0 @@ -getDB(); $db_ak_id = $db->query( @@ -43,7 +44,7 @@ public function processingUnitProvider() $proc_unit_node_1to4 = array_slice($proc_unit_node_1to32, 0, 3); $proc_unit_node_2to8 = array_slice($proc_unit_node_1to32, 1, 3); - $ak_db = new \AppKernel\AppKernelDb(); + $ak_db = new AppKernelDb(); $metrics_id = intval( $ak_db->getDB()->query( 'SELECT metric_id FROM mod_appkernel.metric WHERE name="Wall Clock Time"' @@ -75,7 +76,7 @@ public function processingUnitProvider() */ public function testProcessingUnit($start_date, $end_date, array $resource_ids, array $metrics, $expected) { - $ak_db = new \AppKernel\AppKernelDb(); + $ak_db = new AppKernelDb(); $actual = $ak_db->getProcessingUnits($start_date, $end_date, $resource_ids, $metrics); if ($expected === null) { @@ -245,7 +246,7 @@ public function testGetUniqueAppKernels( $n_expected = null, $expected = null ) { - $ak_db = new \AppKernel\AppKernelDb(); + $ak_db = new AppKernelDb(); $actual = $ak_db->getUniqueAppKernels($resource_ids, $node_counts, $core_counts); if ($expected === null && $n_expected === null) { @@ -284,7 +285,7 @@ public function testGetUniqueAppKernels( public function getMetricsProvider() { - $ak_db = new \AppKernel\AppKernelDb(); + $ak_db = new AppKernelDb(); $db = $ak_db->getDB(); # Get metric id $ak_exec_exists_id = intval( @@ -356,7 +357,7 @@ public function testGetMetrics( $n_expected = null, $expected = null ) { - $ak_db = new \AppKernel\AppKernelDb(); + $ak_db = new AppKernelDb(); $actual = $ak_db->getMetrics($ak_def_id, $start_date, $end_date, $resource_ids, $pu_counts); if ($n_expected === null && $expected !== null) { @@ -434,7 +435,7 @@ public function loadAppKernelInstancesProvider() */ public function testLoadAppKernelInstances($ak_def_id, $resource_id, $n_expected = null, $expected = null) { - $ak_db = new \AppKernel\AppKernelDb(); + $ak_db = new AppKernelDb(); $actual = $ak_db->loadAppKernelInstances($ak_def_id, $resource_id); $db = $ak_db->getDB(); @@ -472,7 +473,7 @@ public function testLoadAppKernelInstances($ak_def_id, $resource_id, $n_expected public function testNewControlRegions() { - $ak_db = new \AppKernel\AppKernelDb(); + $ak_db = new AppKernelDb(); // update initial control for 5 points $ak_db->newControlRegions( diff --git a/tests/unit/phpunit.xml.dist b/tests/unit/phpunit.xml.dist index 578d81b6..50b04a1a 100644 --- a/tests/unit/phpunit.xml.dist +++ b/tests/unit/phpunit.xml.dist @@ -10,7 +10,6 @@ convertWarningsToExceptions="true" forceCoversAnnotation="false" mapTestClassNameToCoveredClassName="false" - printerClass="PHPUnit_TextUI_ResultPrinter" processIsolation="false" stopOnError="false" stopOnFailure="false"