Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve robustness of integration and regression tests. #1256

Merged
merged 2 commits into from
Mar 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 3 additions & 17 deletions tests/integration/lib/BaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,19 @@

namespace IntegrationTests;

use Models\Services\Realms;
use \TestHarness\Utilities;

abstract class BaseTest extends \PHPUnit_Framework_TestCase
{
protected static $XDMOD_REALMS;

public static function setUpBeforeClass()
{
if(!isset(self::$XDMOD_REALMS)) {
$xdmod_realms = array();
$rawRealms = Realms::getRealms();
foreach($rawRealms as $item) {
array_push($xdmod_realms, $item->name);
}
self::$XDMOD_REALMS = $xdmod_realms;
}
self::$XDMOD_REALMS = Utilities::getRealmsToTest();
}

public static function getRealms()
{
if(!isset(self::$XDMOD_REALMS)) {
$xdmod_realms = array();
$rawRealms = Realms::getRealms();
foreach($rawRealms as $item) {
array_push($xdmod_realms, $item->name);
}
return $xdmod_realms;
}
return Utilities::getRealmsToTest();
}
}
3 changes: 3 additions & 0 deletions tests/integration/runtests.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/sh
set -e

XDMOD_REALMS=${XDMOD_REALMS:-'jobs,storage,cloud'}
export XDMOD_REALMS

echo "Integration tests beginning:" `date +"%a %b %d %H:%M:%S.%3N %Y"`

UATCU=""
Expand Down
5 changes: 2 additions & 3 deletions tests/regression/runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ then
junit_output_dir="$2"
fi

if [ -z $XDMOD_REALMS ]; then
export XDMOD_REALMS=$(echo `mysql -Ne "SELECT name FROM moddb.realms"` | tr ' ' ',')
fi
XDMOD_REALMS=${XDMOD_REALMS:-'jobs,storage,cloud'}
export XDMOD_REALMS

# Output PHPUnit logging options. First argument is a unique identifier that
# will be used in the log file name.
Expand Down