Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[INFRA] randomize test order #37

Merged
merged 2 commits into from
May 11, 2023
Merged
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
10 changes: 0 additions & 10 deletions .github/workflows/matlab_test_and_coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,6 @@ jobs:
with:
command: cd(fullfile(getenv('GITHUB_WORKSPACE'), '.github', 'workflows')); run run_tests_ci;

- name: Check logs unix
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
run: grep -q 0 test_report.log || { echo "Some tests failed. Check the 'Run tests' step to know which ones." >&2; exit 1; }
- name: Check logs windows
if: matrix.os == 'windows-latest'
run: |
if (-not (Get-Content test_report.log | Select-String -Pattern "0")) {
throw "Some tests failed. Check the 'Run tests' step to know which ones."
}

- name: Code coverage
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
uses: codecov/codecov-action@v3
Expand Down
13 changes: 4 additions & 9 deletions run_tests.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,15 @@ function run_tests()

else
success = moxunit_runtests(test_folder, ...
'-verbose', '-recursive', '-with_coverage', ...
'-verbose', '-recursive', '-randomize_order', ...
'-with_coverage', ...
'-cover', folder_to_cover, ...
'-cover_xml_file', 'coverage.xml', ...
'-cover_html_dir', fullfile(pwd, 'coverage_html'));
end

fileID = fopen('test_report.log', 'w');
if success
fprintf(fileID, '0');
else
fprintf(fileID, '1');
end
fclose(fileID);

toc;

exit(double(~success));

end