Skip to content

Commit

Permalink
Python3 part8 (#871)
Browse files Browse the repository at this point in the history
First version of Roku Regression test system.
  • Loading branch information
joshua-cogliati-inl authored and alfoa committed Jan 21, 2019
1 parent 838354e commit 7e5b184
Show file tree
Hide file tree
Showing 70 changed files with 5,375 additions and 3,473 deletions.
55 changes: 1 addition & 54 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,65 +1,12 @@
###############################################################################
################### MOOSE Application Standard Makefile #######################
###############################################################################
#
# Optional Environment variables
# MOOSE_DIR - Root directory of the MOOSE project
# HERD_TRUNK_DIR - Location of the HERD repository
# FRAMEWORK_DIR - Location of the MOOSE framework
#
###############################################################################
MOOSE_SUBMODULE := $(CURDIR)/moose
RELAP7_SUBMODULE := $(CURDIR)/relap-7
ifneq ($(wildcard $(MOOSE_SUBMODULE)/framework/Makefile),)
MOOSE_DIR ?= $(MOOSE_SUBMODULE)
else
RELAP7_MOOSE_SUBMODULE := $(RELAP7_SUBMODULE)/moose
ifneq ($(wildcard $(RELAP7_MOOSE_SUBMODULE)/framework/Makefile),)
MOOSE_DIR ?= $(RELAP7_MOOSE_SUBMODULE)
else
MOOSE_DIR ?= $(shell dirname `pwd`)/moose
endif
endif

HERD_TRUNK_DIR ?= $(shell dirname `pwd`)
FRAMEWORK_DIR ?= $(MOOSE_DIR)/framework
ifneq ($(wildcard $(RELAP7_SUBMODULE)/Makefile),)
RELAP7_DIR ?= $(RELAP7_SUBMODULE)
else
RELAP7_DIR ?= $(HERD_TRUNK_DIR)/relap-7
endif
###############################################################################

CURR_DIR := $(CURDIR)

# touch hit.cpp to make sure its time stamp is different than hit.pyx
## this is not a clean solution, but hopefully it prevents asking to use cython
CYTHON_AVOIDANCE_ACTION=$(shell touch $(MOOSE_DIR)/framework/contrib/hit/hit.cpp)


# framework
#include $(FRAMEWORK_DIR)/build.mk
#include $(FRAMEWORK_DIR)/moose.mk

################################## MODULES ####################################
#HEAT_CONDUCTION := yes
#MISC := yes
#FLUID_PROPERTIES := yes
#include $(MOOSE_DIR)/modules/modules.mk
###############################################################################

# RELAP-7
#APPLICATION_DIR := $(RELAP7_DIR)
#APPLICATION_NAME := relap-7
#DEP_APPS := $(shell $(FRAMEWORK_DIR)/scripts/find_dep_apps.py $(APPLICATION_NAME))
#include $(FRAMEWORK_DIR)/app.mk

# CROW
CROW_SUBMODULE := $(CURR_DIR)/crow
ifneq ($(wildcard $(CROW_SUBMODULE)/Makefile),)
CROW_DIR ?= $(CROW_SUBMODULE)
else
CROW_DIR ?= $(HERD_TRUNK_DIR)/crow
$(warning CROW_DIR not found)
endif

all::
Expand Down
135 changes: 0 additions & 135 deletions backend_run_tests

This file was deleted.

2 changes: 0 additions & 2 deletions build_raven
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ if [[ $LIBS_MODE == 0 ]]; then
echo Cleaning old build ...
make clean

# set up hit.cpp so that it has a newer timestamp than hit.pyx
touch moose/framework/contrib/hit/hit.cpp
else
echo Establishing Python libraries ...
. scripts/establish_conda_env.sh --load ${ECE_ARGS}
Expand Down
5 changes: 4 additions & 1 deletion developer_tools/get_coverage_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ def getRegressionTests(whichTests=1,skipExpectedFails=True):
startReading = False
if startReading:
splitted = line.strip().split('=')
testSpecs[splitted[0].strip()] = splitted[1].replace("'","").replace('"','').strip()
if len(splitted) == 2:
testSpecs[splitted[0].strip()] = splitted[1].replace("'","").replace('"','').strip()
if line.strip().startswith("[./"):
startReading = True
collectSpecs = False
Expand All @@ -70,6 +71,8 @@ def getRegressionTests(whichTests=1,skipExpectedFails=True):
# check if test is skipped or an executable is required
if "required_executable" in spec or "skip" in spec:
continue
if "input" not in spec:
continue
testType = spec.get('type',"notfound").strip()
newTest = spec['input'].strip()
testInterfaceOnly = False
Expand Down
4 changes: 4 additions & 0 deletions developer_tools/pylint_check
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ cd $SCRIPT_DIR/..
# activate raven libraries
source $SCRIPT_DIR/../scripts/establish_conda_env.sh --load --quiet

echo Framework
pylint --disable=all --enable=missing-docstring --enable=no-absolute-import --enable=old-division --enable=print-statement --enable=file-builtin --enable=multiple-statements framework/

echo Rook
pylint --disable=fixme,too-few-public-methods,len-as-condition,too-many-locals,too-many-return-statements,too-many-branches,too-many-statements,too-many-instance-attributes,too-many-arguments,no-self-use,similarities,broad-except,consider-using-enumerate,no-member,import-error,old-style-class,not-an-iterable,unexpected-keyword-arg --const-rgx '(([A-Za-z_][A-Za-z0-9_]*)|(__.*__))$' --module-rgx '(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$' --indent-string " " rook/*.py scripts/TestHarness/testers/*.py
2 changes: 1 addition & 1 deletion developer_tools/pylint_list
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ cd $SCRIPT_DIR/..
RGX="[a-zA-Z_]{1,2}[a-zA-Z0-9]{0,50}$"
METHOD_RGX="[a-zA-Z_]{1,2}[a-zA-Z0-9]{2,50}(__)?$"

pylint --indent-string=" " --variable-rgx="$RGX" --attr-rgx="$RGX" --function-rgx="$RGX" --method-rgx="$METHOD_RGX" --const-rgx="$RGX" --argument-rgx="$RGX" --disable=bad-whitespace --disable=line-too-long --disable=multiple-imports --disable=import-error --disable=wrong-import-position --disable=unused-import --disable=wrong-import-order --disable=attribute-defined-outside-init --disable=too-many-branches --disable=too-many-locals --disable=too-many-statements --disable=too-many-nested-blocks --disable=too-many-instance-attributes --enable=missing-docstring --enable=no-absolute-import --enable=old-division --enable=print-statement --enable=file-builtin framework/
pylint --indent-string=" " --variable-rgx="$RGX" --attr-rgx="$RGX" --function-rgx="$RGX" --method-rgx="$METHOD_RGX" --const-rgx="$RGX" --argument-rgx="$RGX" --disable=bad-whitespace --disable=line-too-long --disable=multiple-imports --disable=import-error --disable=wrong-import-position --disable=unused-import --disable=wrong-import-order --disable=attribute-defined-outside-init --disable=too-many-branches --disable=too-many-locals --disable=too-many-statements --disable=too-many-nested-blocks --disable=too-many-instance-attributes --enable=missing-docstring --enable=no-absolute-import --enable=old-division --enable=print-statement --enable=file-builtin --enable=bare-except framework/
3 changes: 3 additions & 0 deletions developer_tools/rook_check
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

pylint --disable=fixme,too-few-public-methods,len-as-condition,too-many-locals,too-many-return-statements,too-many-branches,too-many-statements,too-many-instance-attributes,too-many-arguments,no-self-use,similarities,broad-except,consider-using-enumerate --const-rgx '(([A-Za-z_][A-Za-z0-9_]*)|(__.*__))$' --indent-string " " rook/*.py scripts/TestHarness/testers/*.py
4 changes: 2 additions & 2 deletions framework/Driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ def checkVersions():
sys.path.append(os.path.join(os.path.dirname(frameworkDir),"scripts","TestHarness","testers"))
import RavenUtils
sys.path.pop() #remove testers path
missing,outOfRange,notQA = RavenUtils.checkForMissingModules(False)
if len(missing) + len(outOfRange) > 0 and RavenUtils.checkVersions():
missing,outOfRange,notQA = RavenUtils.check_for_missing_modules(False)
if len(missing) + len(outOfRange) > 0 and RavenUtils.check_versions():
print("ERROR: too old, too new, or missing raven libraries, not running:")
for error in missing + outOfRange + notQA:
print(error)
Expand Down
11 changes: 2 additions & 9 deletions raven.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,9 @@ SHELL := /bin/bash
include $(RAVEN_DIR)/amsc.mk
###############################################################################

################################################################################
## Build system for "hit", required by moose regression test system
hit $(MOOSE_DIR)/python/hit.so:: $(FRAMEWORK_DIR)/contrib/hit/hit.cpp $(FRAMEWORK_DIR)/contrib/hit/lex.cc $(FRAMEWORK_DIR)/contrib/hit/parse.cc
bash -c 'cd scripts/TestHarness/hit-windows && ./build_hit.sh'
###############################################################################

framework_modules:: amsc python_crow_modules hit
framework_modules:: amsc python_crow_modules

all:: amsc python_crow_modules hit
all:: amsc python_crow_modules

####################################################################################
# find and remove all the *.pyc files (better safe then sorry) #
Expand All @@ -41,7 +35,6 @@ clean::
$(MOOSE_DIR)/python/hit.pyd
@rm -Rf $(RAVEN_DIR)/build $(FRAMEWORK_DIR)/contrib/hit/build
@find $(RAVEN_DIR)/framework -name '*.pyc' -exec rm '{}' \;
$(MAKE) -C $(FRAMEWORK_DIR)/contrib/hit clean

cleanall::
make -C $(RAVEN_DIR) clean
63 changes: 63 additions & 0 deletions rook/GenericExecutable.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Copyright 2017 Battelle Energy Alliance, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#from util import *
"""
Tests by running an executable.
"""
from Tester import Tester

class GenericExecutable(Tester):
"""
A generic executable test interface.
"""

@staticmethod
def get_valid_params():
"""
Return a list of valid parameters and their descriptions for this type
of test.
@ In, None
@ Out, params, _ValidParameters, the parameters for this class.
"""
params = Tester.get_valid_params()
params.add_required_param('executable', "The executable to use")
params.add_param('parameters', '', "arguments to the executable")
return params

def get_command(self):
"""
Return the command this test will run.
@ In, None
@ Out, get_command, string, command to run
"""
return self.specs["executable"]+" "+self.specs["parameters"]

def __init__(self, name, params):
"""
Constructor that will setup this test with a name and a list of
parameters.
@ In, name: the name of this test case.
@ In, params, a dictionary of parameters and their values to use.
"""
Tester.__init__(self, name, params)

def process_results(self, output):
""" Handle the results of test case.
@ In, output, string, the output from the test case.
@ Out, None
"""
if self.results.exit_code != 0:
self.set_fail(str(self.results.exit_code))
return
self.set_success()
Loading

0 comments on commit 7e5b184

Please sign in to comment.