Skip to content

Commit 31cfae6

Browse files
authored
Collect more logs on hourly failure (#61)
* Collect more logs * Specify shell on Azure * Switch to bash key * Ignore failed reads on tar in Circle * Add TEMP and TMPDIR env var export for artifact upload on failure * Attempt to collect core dumps on Linux and macOS * Remove core dump collection
1 parent aabd907 commit 31cfae6

File tree

3 files changed

+45
-13
lines changed

3 files changed

+45
-13
lines changed

.circleci/config.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ jobs:
66
machine:
77
image: ubuntu-2204:current
88
environment:
9-
MATLAB_LOG_DIR: /home/circleci/project/logs
9+
MATLAB_LOG_DIR: /home/circleci/project/mw_logs
10+
MW_INSTALLER_DDUX_LOG: /home/circleci/project/mw_logs/mw_installer_ddux.log
1011
MW_DIAGNOSTIC_DEST: file
1112
MW_DIAGNOSTIC_SPEC: cppmicroservices::framework.*=all;install.*=all;
1213
MW_VERBOSE_HTTPCLIENT_CORE: 1
@@ -23,10 +24,10 @@ jobs:
2324
- matlab/run-tests:
2425
source-folder: code
2526
- run:
26-
command: tar -cvzf matlab-logs.tar /home/circleci/project/logs
27+
command: tar --ignore-failed-read -cvzf mw-logs.tar /home/circleci/project/mw_logs /tmp/mathworks_*.log
2728
when: on_fail
28-
- store_artifacts:
29-
path: matlab-logs.tar
29+
- store_artifacts:
30+
path: mw-logs.tar
3031
when: on_fail
3132

3233
# As an alternative to run-tests, you can use run-command to execute a MATLAB script, function, or statement.

.github/workflows/ci.yml

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ jobs:
6060
runs-on: ${{ matrix.os }}
6161

6262
env:
63-
MATLAB_LOG_DIR: ${{ github.workspace }}/logs
63+
MATLAB_LOG_DIR: ${{ github.workspace }}/mw_logs
64+
MW_INSTALLER_DDUX_LOG: ${{ github.workspace }}/mw_logs/mw_installer_ddux.log
6465
MW_DIAGNOSTIC_DEST: file
6566
MW_DIAGNOSTIC_SPEC: cppmicroservices::framework.*=all;install.*=all;
6667
MW_VERBOSE_HTTPCLIENT_CORE: 1
@@ -83,12 +84,23 @@ jobs:
8384
with:
8485
source-folder: code
8586

87+
- name: Export TEMP and TMPDIR env vars for artifact upload
88+
if: ${{ failure() }}
89+
run: |
90+
echo "TEMP=$TEMP" >> $GITHUB_ENV
91+
echo "TMPDIR=$TMPDIR" >> $GITHUB_ENV
92+
shell: bash
93+
8694
- name: Upload MPM and MATLAB logs
8795
if: ${{ failure() }}
8896
uses: actions/upload-artifact@v4
8997
with:
90-
name: matlab-logs-${{ github.job }}-${{ matrix.os }}
91-
path: ${{ env.MATLAB_LOG_DIR }}
98+
name: mw-logs-${{ github.job }}-${{ matrix.os }}
99+
path: |
100+
${{ env.MATLAB_LOG_DIR }}
101+
${{ env.TEMP }}/mathworks_*.log
102+
${{ env.TMPDIR }}/mathworks_*.log
103+
/tmp/mathworks_*.log
92104
if-no-files-found: ignore
93105

94106
- name: Send mail
@@ -115,7 +127,8 @@ jobs:
115127
runs-on: ${{ matrix.os }}
116128

117129
env:
118-
MATLAB_LOG_DIR: ${{ github.workspace }}/logs
130+
MATLAB_LOG_DIR: ${{ github.workspace }}/mw_logs
131+
MW_INSTALLER_DDUX_LOG: ${{ github.workspace }}/mw_logs/mw_installer_ddux.log
119132
MW_DIAGNOSTIC_DEST: file
120133
MW_DIAGNOSTIC_SPEC: cppmicroservices::framework.*=all;install.*=all;
121134
MW_VERBOSE_HTTPCLIENT_CORE: 1
@@ -139,12 +152,23 @@ jobs:
139152
with:
140153
source-folder: code
141154

155+
- name: Export TEMP and TMPDIR env vars for artifact upload
156+
if: ${{ failure() }}
157+
run: |
158+
echo "TEMP=$TEMP" >> $GITHUB_ENV
159+
echo "TMPDIR=$TMPDIR" >> $GITHUB_ENV
160+
shell: bash
161+
142162
- name: Upload MPM and MATLAB logs
143163
if: ${{ failure() }}
144164
uses: actions/upload-artifact@v4
145165
with:
146-
name: matlab-logs-${{ github.job }}-${{ matrix.os }}
147-
path: ${{ env.MATLAB_LOG_DIR }}
166+
name: mw-logs-${{ github.job }}-${{ matrix.os }}
167+
path: |
168+
${{ env.MATLAB_LOG_DIR }}
169+
${{ env.TEMP }}/mathworks_*.log
170+
${{ env.TMPDIR }}/mathworks_*.log
171+
/tmp/mathworks_*.log
148172
if-no-files-found: ignore
149173

150174
- name: Send mail

azure-pipelines.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
pool:
22
vmImage: ubuntu-latest
33
variables:
4-
MATLAB_LOG_DIR: $(Build.SourcesDirectory)/logs
4+
MATLAB_LOG_DIR: $(Build.SourcesDirectory)/mw_logs
5+
MW_INSTALLER_DDUX_LOG: $(Build.SourcesDirectory)/mw_logs/mw_installer_ddux.log
56
MW_DIAGNOSTIC_DEST: file
67
MW_DIAGNOSTIC_SPEC: cppmicroservices::framework.*=all;install.*=all;
78
MW_VERBOSE_HTTPCLIENT_CORE: 1
@@ -26,11 +27,17 @@ steps:
2627
codeCoverageTool: Cobertura
2728
summaryFileLocation: code-coverage/coverage.xml
2829
pathToSources: code/
30+
- bash: |
31+
mkdir -p $(Build.ArtifactStagingDirectory)/mw_logs
32+
cp -r $(MATLAB_LOG_DIR)/* $(Build.ArtifactStagingDirectory)/mw_logs/ || true
33+
cp -v /tmp/mathworks_*.log $(Build.ArtifactStagingDirectory)/mw_logs/ || true
34+
condition: failed()
35+
displayName: Gather MPM and MATLAB logs
2936
- task: PublishBuildArtifacts@1
3037
condition: failed()
3138
inputs:
32-
PathtoPublish: $(MATLAB_LOG_DIR)
33-
ArtifactName: matlab-logs
39+
PathtoPublish: $(Build.ArtifactStagingDirectory)/mw_logs
40+
ArtifactName: mw-logs
3441
displayName: Publish MPM and MATLAB logs
3542

3643
# As an alternative to RunMATLABTests, you can use RunMATLABCommand to execute a MATLAB script, function, or statement.

0 commit comments

Comments
 (0)