Skip to content

Commit

Permalink
Increase logging to aid with failure debugging in hourly (#44)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
mcafaro authored Nov 4, 2024
1 parent cfd4d6f commit e73b25d
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 6 deletions.
11 changes: 11 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,23 @@ jobs:
build:
machine:
image: ubuntu-2204:current
environment:
MATLAB_LOG_DIR: /home/circleci/project/logs
MW_DIAGNOSTIC_DEST: file
MW_DIAGNOSTIC_SPEC: cppmicroservices::framework.*=all;install.*=all;
MW_VERBOSE_HTTPCLIENT_CORE: 1
steps:
- checkout
- matlab/install:
products: Optimization_Toolbox Curve_Fitting_Toolbox
- matlab/run-tests:
source-folder: code
- run:
command: tar -cvzf matlab-logs.tar /home/circleci/project/logs
when: on_fail
- store_artifacts:
path: matlab-logs.tar
when: on_fail

# As an alternative to run-tests, you can use run-command to execute a MATLAB script, function, or statement.
# - matlab/run-command:
Expand Down
30 changes: 29 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ jobs:
fail-fast: false
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}

env:
MATLAB_LOG_DIR: ${{ github.workspace }}/logs
MW_DIAGNOSTIC_DEST: file
MW_DIAGNOSTIC_SPEC: cppmicroservices::framework.*=all;install.*=all;
MW_VERBOSE_HTTPCLIENT_CORE: 1

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

- name: Upload MPM and MATLAB logs
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: matlab-logs-${{ github.job }}-${{ matrix.os }}
path: ${{ env.MATLAB_LOG_DIR }}
if-no-files-found: ignore

- name: Send mail
if: ${{ failure() }}
uses: dawidd6/action-send-mail@v3
Expand All @@ -97,6 +111,12 @@ jobs:
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}

env:
MATLAB_LOG_DIR: ${{ github.workspace }}/logs
MW_DIAGNOSTIC_DEST: file
MW_DIAGNOSTIC_SPEC: cppmicroservices::framework.*=all;install.*=all;
MW_VERBOSE_HTTPCLIENT_CORE: 1

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
Expand All @@ -116,6 +136,14 @@ jobs:
with:
source-folder: code

- name: Upload MPM and MATLAB logs
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: matlab-logs-${{ github.job }}-${{ matrix.os }}
path: ${{ env.MATLAB_LOG_DIR }}
if-no-files-found: ignore

- name: Send mail
if: ${{ failure() }}
uses: dawidd6/action-send-mail@v3
Expand All @@ -128,4 +156,4 @@ jobs:
to: ${{ secrets.CI_INTERNAL_EMAIL }}
from: ${{ secrets.MAIL_USERNAME }}
secure: true
body: ${{ github.job }} job in workflow ${{ github.workflow }} of ${{ github.repository }} has ${{ job.status }}
body: ${{ github.job }} job in workflow ${{ github.workflow }} of ${{ github.repository }} has ${{ job.status }}
21 changes: 16 additions & 5 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
pool:
vmImage: ubuntu-latest
variables:
MATLAB_LOG_DIR: $(Build.SourcesDirectory)/logs
MW_DIAGNOSTIC_DEST: file
MW_DIAGNOSTIC_SPEC: cppmicroservices::framework.*=all;install.*=all;
MW_VERBOSE_HTTPCLIENT_CORE: 1
steps:
- task: InstallMATLAB@1
inputs:
Expand All @@ -12,14 +17,20 @@ steps:
- task: PublishTestResults@2
condition: always()
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: 'test-results/results.xml'
testResultsFormat: JUnit
testResultsFiles: test-results/results.xml
- task: PublishCodeCoverageResults@2
condition: always()
inputs:
codeCoverageTool: 'Cobertura'
summaryFileLocation: 'code-coverage/coverage.xml'
pathToSources: 'code/'
codeCoverageTool: Cobertura
summaryFileLocation: code-coverage/coverage.xml
pathToSources: code/
- task: PublishBuildArtifacts@1
condition: failed()
inputs:
PathtoPublish: $(MATLAB_LOG_DIR)
ArtifactName: matlab-logs
displayName: Publish MPM and MATLAB logs

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

0 comments on commit e73b25d

Please sign in to comment.