Skip to content

Commit

Permalink
This should fix current test error in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mldiego committed Oct 18, 2023
1 parent 22b07fd commit e35249b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,4 @@ jobs:
- name: Run all tests
uses: matlab-actions/run-command@v1
with:
command: disp('Running NNV custom testing procedure!'); cd("code/nnv"); addpath(genpath(pwd)); disp(is_container()); disp(pwd);
# command: disp('Running NNV custom testing procedure!'); cd("code/nnv"); install; results = runtests('tests', 'IncludeSubfolders', true); assertSuccess(results);
command: disp('Running NNV custom testing procedure!'); mkdir('/github_actions-true'); cd("code/nnv"); install; results = runtests('tests', 'IncludeSubfolders', true); assertSuccess(results);
2 changes: 0 additions & 2 deletions code/nnv/engine/utils/is_container.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
out = 0;
end
% 'docker container detected'
elseif isfolder('/home/runner/work/') % for GitHub actions
out = 1;
else
out = 0;
% 'docker container not detected'
Expand Down
10 changes: 10 additions & 0 deletions code/nnv/engine/utils/is_github_actions.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
function out = is_github_actions()
if isfolder('/github_actions-true')
out = 1;
% 'github actions detected'
else
out = 0;
% 'github actions not detected'
end
end

2 changes: 1 addition & 1 deletion code/nnv/tests/io/test_io.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


%% Test 3: Load onnx model
if ~is_container() % importers (support packages) are not installed in MATLAB actions
if ~is_github_actions() % importers (support packages) are not installed in MATLAB actions
net_onnx = importONNXNetwork('mobilenetv2-1.0.onnx');
% net = matlab2nnv(net_onnx);
% This should get error:
Expand Down
4 changes: 2 additions & 2 deletions code/nnv/tests/tutorial/test_all_tutorial.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
cd ../../examples/Tutorial/NN/'ACAS Xu'/;

%% 1) NN: ACAS Xu (verify_onnx_vnnlib)
if ~is_container() % importers (support packages) are not installed
if ~is_github_actions() % importers (support packages) are not installed
verify_onnx_vnnlib;
end

Expand Down Expand Up @@ -51,7 +51,7 @@

%% 14) Other: load models
cd ../../other;
if ~is_container() % importers (support packages) are not installed
if ~is_github_actions() % importers (support packages) are not installed
load_models;
end

Expand Down

0 comments on commit e35249b

Please sign in to comment.