Skip to content

Commit

Permalink
Altered internal dashboard's App Kernel Walltime and Schedule to use …
Browse files Browse the repository at this point in the history
…NewRest

stack instead of old REST AKRR.
  • Loading branch information
jsperhac committed Apr 11, 2017
1 parent 17b2c3f commit 1288d6e
Show file tree
Hide file tree
Showing 10 changed files with 128 additions and 1,894 deletions.
590 changes: 0 additions & 590 deletions classes/REST/AKRR/Akrr.php

This file was deleted.

1,296 changes: 0 additions & 1,296 deletions classes/REST/Appkernel/Explorer.php

This file was deleted.

6 changes: 3 additions & 3 deletions html/internal_dashboard/js/Arr/CreateSchedulePanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ XDMoD.Arr.CreateSchedulePanel = Ext.extend(Ext.FormPanel, {
idProperty: 'id',
proxy: new Ext.data.HttpProxy({
method: 'GET',
url: '/rest/AKRR/AKRR/resources?token=' + XDMoD.REST.token
url: XDMoD.REST.url + '/akrr/resources?token=' + XDMoD.REST.token
}),
fields: [
{name: 'id', type: 'int'},
Expand All @@ -277,7 +277,7 @@ XDMoD.Arr.CreateSchedulePanel = Ext.extend(Ext.FormPanel, {
idProperty: 'id',
proxy: new Ext.data.HttpProxy({
method: 'GET',
url: '/rest/AKRR/AKRR/kernels?token=' + XDMoD.REST.token,
url: XDMoD.REST.url + '/akrr/kernels?token=' + XDMoD.REST.token,
baseParams: {
disabled: false
}
Expand Down Expand Up @@ -738,4 +738,4 @@ XDMoD.Arr.CreateSchedulePanel = Ext.extend(Ext.FormPanel, {

return str;
}
});
});
6 changes: 3 additions & 3 deletions html/internal_dashboard/js/Arr/WalltimeEditEntryPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ XDMoD.Arr.WalltimeEditEntryPanel = Ext.extend(Ext.FormPanel, {
idProperty: 'id',
proxy: new Ext.data.HttpProxy({
method: 'GET',
url: '/rest/AKRR/AKRR/kernels?token=' + XDMoD.REST.token,
url: XDMoD.REST.url + '/akrr/kernels?token=' + XDMoD.REST.token,
baseParams: {
disabled: true
}
Expand Down Expand Up @@ -258,7 +258,7 @@ XDMoD.Arr.WalltimeEditEntryPanel = Ext.extend(Ext.FormPanel, {
idProperty: 'id',
proxy: new Ext.data.HttpProxy({
method: 'GET',
url: '/rest/AKRR/AKRR/resources?token=' + XDMoD.REST.token
url: XDMoD.REST.url + '/akrr/resources?token=' + XDMoD.REST.token
}),
fields: [
{name: 'id', type: 'int'},
Expand Down Expand Up @@ -448,4 +448,4 @@ XDMoD.Arr.WalltimeEditEntryPanel = Ext.extend(Ext.FormPanel, {
}
} // _clear
})
;
;
4 changes: 2 additions & 2 deletions html/internal_dashboard/js/Arr/WalltimeNewEntryPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ XDMoD.Arr.WalltimeNewEntryPanel = Ext.extend(Ext.FormPanel, {
idProperty: 'id',
proxy: new Ext.data.HttpProxy({
method: 'GET',
url: '/rest/AKRR/AKRR/kernels?token=' + XDMoD.REST.token,
url: XDMoD.REST.url + '/akrr/kernels?token=' + XDMoD.REST.token,
baseParams: {
disabled: true
}
Expand Down Expand Up @@ -257,7 +257,7 @@ XDMoD.Arr.WalltimeNewEntryPanel = Ext.extend(Ext.FormPanel, {
idProperty: 'id',
proxy: new Ext.data.HttpProxy({
method: 'GET',
url: '/rest/AKRR/AKRR/resources?token=' + XDMoD.REST.token
url: XDMoD.REST.url + '/akrr/resources?token=' + XDMoD.REST.token
}),
fields: [
{name: 'id', type: 'int'},
Expand Down
7 changes: 7 additions & 0 deletions tests/integration_tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
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
20 changes: 20 additions & 0 deletions tests/integration_tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

$dir = __DIR__;

// Autoloader for main framework test classes.
spl_autoload_register(
function ($className) use ($dir) {
$classPath
= $dir
. '/../../../xdmod/open_xdmod/modules/xdmod/integration_tests/lib/'
. str_replace('\\', '/', $className)
. '.php';

if (is_readable($classPath)) {
return require_once $classPath;
} else {
return false;
}
}
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?php

namespace IntegrationTests\REST\internal_dashboard;

class DashboardAppKernelTest extends \PHPUnit_Framework_TestCase
{
public function __construct()
{
$xdmodConfig = array( "decodetextasjson" => true );
$this->xdmodhelper = new \TestHarness\XdmodTestHelper($xdmodConfig);

$this->endpoint = 'rest/v0.1/akrr/';
$this->xdmodhelper->authenticate("mgr");
}

private function validateAkrrResourceEntries($searchparams)
{
$this->xdmodhelper->authenticate("mgr");

$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);

$data = $result[0]['data'];
foreach ($data as $item) {
$this->assertArrayHasKey('id', $item);
$this->assertArrayHasKey('name', $item);
}

return $data;
}

public function testResourceNullParam()
{
$data = $this->validateAkrrResourceEntries(null);
$this->assertGreaterThanOrEqual(1, sizeof($data));
}

private function validateAkrrKernelEntries($searchparams)
{
$this->xdmodhelper->authenticate("mgr");

$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');

$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]);
}

return $data;
}

public function testKernelNullParam()
{
$data = $this->validateAkrrKernelEntries(null);
$this->assertGreaterThanOrEqual(1, sizeof($data));
}
}
21 changes: 21 additions & 0 deletions tests/integration_tests/phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.5/phpunit.xsd"
backupGlobals="true"
backupStaticAttributes="false"
bootstrap="bootstrap.php"
cacheTokens="true"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
forceCoversAnnotation="false"
mapTestClassNameToCoveredClassName="false"
printerClass="PHPUnit_TextUI_ResultPrinter"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
stopOnIncomplete="false"
stopOnSkipped="false"
testSuiteLoaderClass="PHPUnit_Runner_StandardTestSuiteLoader"
verbose="true">
</phpunit>
5 changes: 5 additions & 0 deletions tests/integration_tests/runtests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

set -e

phpunit `dirname $0`

0 comments on commit 1288d6e

Please sign in to comment.