Skip to content

Commit e73b25d

Browse files
authored
Increase logging to aid with failure debugging in hourly (#44)
* Increase logging to aid with failure debugging * Increase compression and reduce retention * Hardcode path in Circle * Expand tilde on Circle * Only store logs on failure * Prints logs in Circle * Fix printing of logs on Circle * Only print logs on failure in Circle * Use store_artifacts again on Circle * Remove unnecessary space * Remove unnecessary quotes
1 parent cfd4d6f commit e73b25d

File tree

3 files changed

+56
-6
lines changed

3 files changed

+56
-6
lines changed

.circleci/config.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,23 @@ jobs:
55
build:
66
machine:
77
image: ubuntu-2204:current
8+
environment:
9+
MATLAB_LOG_DIR: /home/circleci/project/logs
10+
MW_DIAGNOSTIC_DEST: file
11+
MW_DIAGNOSTIC_SPEC: cppmicroservices::framework.*=all;install.*=all;
12+
MW_VERBOSE_HTTPCLIENT_CORE: 1
813
steps:
914
- checkout
1015
- matlab/install:
1116
products: Optimization_Toolbox Curve_Fitting_Toolbox
1217
- matlab/run-tests:
1318
source-folder: code
19+
- run:
20+
command: tar -cvzf matlab-logs.tar /home/circleci/project/logs
21+
when: on_fail
22+
- store_artifacts:
23+
path: matlab-logs.tar
24+
when: on_fail
1425

1526
# As an alternative to run-tests, you can use run-command to execute a MATLAB script, function, or statement.
1627
# - matlab/run-command:

.github/workflows/ci.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ jobs:
5555
fail-fast: false
5656
# The type of runner that the job will run on
5757
runs-on: ${{ matrix.os }}
58+
59+
env:
60+
MATLAB_LOG_DIR: ${{ github.workspace }}/logs
61+
MW_DIAGNOSTIC_DEST: file
62+
MW_DIAGNOSTIC_SPEC: cppmicroservices::framework.*=all;install.*=all;
63+
MW_VERBOSE_HTTPCLIENT_CORE: 1
5864

5965
# Steps represent a sequence of tasks that will be executed as part of the job
6066
steps:
@@ -74,6 +80,14 @@ jobs:
7480
with:
7581
source-folder: code
7682

83+
- name: Upload MPM and MATLAB logs
84+
if: ${{ failure() }}
85+
uses: actions/upload-artifact@v4
86+
with:
87+
name: matlab-logs-${{ github.job }}-${{ matrix.os }}
88+
path: ${{ env.MATLAB_LOG_DIR }}
89+
if-no-files-found: ignore
90+
7791
- name: Send mail
7892
if: ${{ failure() }}
7993
uses: dawidd6/action-send-mail@v3
@@ -97,6 +111,12 @@ jobs:
97111
# The type of runner that the job will run on
98112
runs-on: ${{ matrix.os }}
99113

114+
env:
115+
MATLAB_LOG_DIR: ${{ github.workspace }}/logs
116+
MW_DIAGNOSTIC_DEST: file
117+
MW_DIAGNOSTIC_SPEC: cppmicroservices::framework.*=all;install.*=all;
118+
MW_VERBOSE_HTTPCLIENT_CORE: 1
119+
100120
# Steps represent a sequence of tasks that will be executed as part of the job
101121
steps:
102122
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
@@ -116,6 +136,14 @@ jobs:
116136
with:
117137
source-folder: code
118138

139+
- name: Upload MPM and MATLAB logs
140+
if: ${{ failure() }}
141+
uses: actions/upload-artifact@v4
142+
with:
143+
name: matlab-logs-${{ github.job }}-${{ matrix.os }}
144+
path: ${{ env.MATLAB_LOG_DIR }}
145+
if-no-files-found: ignore
146+
119147
- name: Send mail
120148
if: ${{ failure() }}
121149
uses: dawidd6/action-send-mail@v3
@@ -128,4 +156,4 @@ jobs:
128156
to: ${{ secrets.CI_INTERNAL_EMAIL }}
129157
from: ${{ secrets.MAIL_USERNAME }}
130158
secure: true
131-
body: ${{ github.job }} job in workflow ${{ github.workflow }} of ${{ github.repository }} has ${{ job.status }}
159+
body: ${{ github.job }} job in workflow ${{ github.workflow }} of ${{ github.repository }} has ${{ job.status }}

azure-pipelines.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
pool:
22
vmImage: ubuntu-latest
3+
variables:
4+
MATLAB_LOG_DIR: $(Build.SourcesDirectory)/logs
5+
MW_DIAGNOSTIC_DEST: file
6+
MW_DIAGNOSTIC_SPEC: cppmicroservices::framework.*=all;install.*=all;
7+
MW_VERBOSE_HTTPCLIENT_CORE: 1
38
steps:
49
- task: InstallMATLAB@1
510
inputs:
@@ -12,14 +17,20 @@ steps:
1217
- task: PublishTestResults@2
1318
condition: always()
1419
inputs:
15-
testResultsFormat: 'JUnit'
16-
testResultsFiles: 'test-results/results.xml'
20+
testResultsFormat: JUnit
21+
testResultsFiles: test-results/results.xml
1722
- task: PublishCodeCoverageResults@2
1823
condition: always()
1924
inputs:
20-
codeCoverageTool: 'Cobertura'
21-
summaryFileLocation: 'code-coverage/coverage.xml'
22-
pathToSources: 'code/'
25+
codeCoverageTool: Cobertura
26+
summaryFileLocation: code-coverage/coverage.xml
27+
pathToSources: code/
28+
- task: PublishBuildArtifacts@1
29+
condition: failed()
30+
inputs:
31+
PathtoPublish: $(MATLAB_LOG_DIR)
32+
ArtifactName: matlab-logs
33+
displayName: Publish MPM and MATLAB logs
2334

2435
# As an alternative to RunMATLABTests, you can use RunMATLABCommand to execute a MATLAB script, function, or statement.
2536
# - task: RunMATLABCommand@1

0 commit comments

Comments
 (0)