diff --git a/.github/workflows/workflow-tools.yml b/.github/workflows/workflow-tools.yml new file mode 100644 index 0000000..fd77b05 --- /dev/null +++ b/.github/workflows/workflow-tools.yml @@ -0,0 +1,31 @@ +name: workflow-tools + +on: + pull_request: + branches: + master + push: + branches: + master + schedule: + - cron: '1 12 * * *' + +jobs: + workflow-tools-test: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v1 + with: + submodules: recursive + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Test with nose2 + run: | + pip install nose2 + cd tool_integration && nose2 -v diff --git a/.gitmodules b/.gitmodules index a7d55c8..48631df 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "GNPS_Workflows"] path = GNPS_Workflows url = https://github.com/CCMS-UCSD/GNPS_Workflows.git +[submodule "CCMS-Workflow-Tools"] + path = CCMS-Workflow-Tools + url = git@github.com:CCMS-UCSD/CCMS-Workflow-Tools.git diff --git a/CCMS-Workflow-Tools b/CCMS-Workflow-Tools new file mode 160000 index 0000000..5966211 --- /dev/null +++ b/CCMS-Workflow-Tools @@ -0,0 +1 @@ +Subproject commit 596621172723d15ca3df5892daa9364e91b89002 diff --git a/tool_integration/test_tools.py b/tool_integration/test_tools.py new file mode 100644 index 0000000..9bb5b7a --- /dev/null +++ b/tool_integration/test_tools.py @@ -0,0 +1,37 @@ + I A bin/test_tools.py (Modified)(python) def test_all_submodule_tools(): Row 34 Col 35 3:15 Ctrl-K H for help +#!/usr/bin/python + +import argparse +import configparser +import os +import sys + +# set up script constants +DEFAULT_SUBMODULE = "CCMS-Workflow-Tools" + +def test_all_submodule_tools(): + # get command line arguments + argument_parser = argparse.ArgumentParser() + argument_parser.add_argument("-s", "--submodule", help="Name of submodule repository to search for test configurations to run.") + arguments = argument_parser.parse_args(sys.argv[1:]) + # if argument submodule is not specified, use the default + submodule = arguments.submodule + if not submodule: + submodule = DEFAULT_SUBMODULE + # argument submodule should be present directly under working directory + assert(os.path.isdir(submodule), "Specified submodule [" + submodule + "] could not be found in this test environment.") + # check all top-level directories of the argument submodule + directories = os.listdir(submodule) + for directory in directories: + if os.path.isdir(directory): + # look for a "test" subdirectory under this directory + test_directory = os.path.join(directory, "test") + if os.path.isdir(test_directory): + # look for a "test.properties" file under this test subdirectory + test_properties_file = os.path.join(test_directory, "test.properties") + if os.path.isfile(test_properties_file): + configuration = configparser.RawConfigParser() + configuration.read(test_properties_file) + test_parameters = dict(configuration.items("test properties")) + test_command = test_parameters["test_command"] + print("Test command = [" + test_command + "]")