Skip to content
Open
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
31 changes: 31 additions & 0 deletions .github/workflows/workflow-tools.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [email protected]:CCMS-UCSD/CCMS-Workflow-Tools.git
1 change: 1 addition & 0 deletions CCMS-Workflow-Tools
Submodule CCMS-Workflow-Tools added at 596621
37 changes: 37 additions & 0 deletions tool_integration/test_tools.py
Original file line number Diff line number Diff line change
@@ -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 + "]")