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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
run: ruff check . --output-format=github

test:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
Expand Down
4 changes: 2 additions & 2 deletions TestConcoreHpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ static void test_load_params_semicolon_format() {

static void test_tryparam_comma_in_value() {
setup_dirs();
write_file("in/1/concore.params", "{'channels': [1, 2], 'gain': '0.5'}");
write_file("in1/concore.params", "{'channels': [1, 2], 'gain': '0.5'}");

Concore c;
c.delay = 0;
Expand All @@ -342,7 +342,7 @@ static void test_tryparam_comma_in_value() {
check("tryparam preserves list with comma", c.tryparam("channels", "") == "[1, 2]");
check("tryparam preserves subsequent key", c.tryparam("gain", "") == "0.5");

rm("in/1/concore.params");
rm("in1/concore.params");
}

// ------------- main -------------------------------------------------------
Expand Down
10 changes: 5 additions & 5 deletions mkconcore.py
Original file line number Diff line number Diff line change
Expand Up @@ -1279,13 +1279,13 @@ def cleanup_script_files():
fdebug.write('cd ..\n')
fdebug.write('start /D '+q_container+' cmd /K '+JAVAWIN+' -cp .;..\\src\\jeromq.jar '+javaclass+'\n')
elif langext=="m": #3/23/21
# Use q_source in Windows commands to ensure quoting consistency
# single quotes around the file name, q_source would nest double quotes in "run(...)"
if M_IS_OCTAVE:
frun.write('start /B /D '+q_container+" "+OCTAVEWIN+' -qf --eval "run('+q_source+')"'+" >"+q_container+"\\concoreout.txt\n")
fdebug.write('start /D '+q_container+" cmd /K " +OCTAVEWIN+' -qf --eval "run('+q_source+')"'+"\n")
frun.write('start /B /D '+q_container+" "+OCTAVEWIN+' -qf --eval "run('+"'"+sourcecode+"'"+')"'+" >"+q_container+"\\concoreout.txt\n")
fdebug.write('start /D '+q_container+" cmd /K " +OCTAVEWIN+' -qf --eval "run('+"'"+sourcecode+"'"+')"'+"\n")
else: # 4/2/21
frun.write('start /B /D '+q_container+" "+MATLABWIN+' -batch "run('+q_source+')"'+" >"+q_container+"\\concoreout.txt\n")
fdebug.write('start /D '+q_container+" cmd /K " +MATLABWIN+' -batch "run('+q_source+')"'+"\n")
frun.write('start /B /D '+q_container+" "+MATLABWIN+' -batch "run('+"'"+sourcecode+"'"+')"'+" >"+q_container+"\\concoreout.txt\n")
fdebug.write('start /D '+q_container+" cmd /K " +MATLABWIN+' -batch "run('+"'"+sourcecode+"'"+')"'+"\n")
else:
#use shlex.quote for POSIX systems
safe_container = shlex.quote(containername)
Expand Down
39 changes: 39 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,45 @@ def test_build_command_windows_java_node(self):
run_script,
)

def test_build_command_windows_matlab_node(self):
with self.runner.isolated_filesystem(temp_dir=self.temp_dir):
result = self.runner.invoke(cli, ["init", "test-project"])
self.assertEqual(result.exit_code, 0)

Path("test-project/src/script.py").rename("test-project/src/script.m")
workflow_path = Path("test-project/workflow.graphml")
content = workflow_path.read_text()
workflow_path.write_text(content.replace("N1:script.py", "N1:script.m"))

result = self.runner.invoke(
cli,
[
"build",
"test-project/workflow.graphml",
"--source",
"test-project/src",
"--output",
"out",
"--type",
"windows",
],
)
self.assertEqual(result.exit_code, 0)

# the file name has to be single quoted, nested double quotes
# turn it into run(script.m)
run_script = Path("out/run.bat").read_text()
debug_script = Path("out/debug.bat").read_text()
repo_root = Path(__file__).resolve().parents[1]
if (repo_root / "concore.octave").exists():
expected = "-qf --eval \"run('script.m')\""
else:
expected = "-batch \"run('script.m')\""
self.assertIn(expected, run_script)
self.assertIn(expected, debug_script)
self.assertNotIn('run("script.m")', run_script)
self.assertNotIn('run("script.m")', debug_script)

def test_build_command_docker_java_node(self):
with self.runner.isolated_filesystem(temp_dir=self.temp_dir):
result = self.runner.invoke(cli, ["init", "test-project"])
Expand Down
Loading