From e73b25d6f1ebeaf3c6fbd40706eac75949202ec0 Mon Sep 17 00:00:00 2001 From: Mark Cafaro <34887852+mcafaro@users.noreply.github.com> Date: Mon, 4 Nov 2024 15:31:31 -0500 Subject: [PATCH] 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 --- .circleci/config.yml | 11 +++++++++++ .github/workflows/ci.yml | 30 +++++++++++++++++++++++++++++- azure-pipelines.yml | 21 ++++++++++++++++----- 3 files changed, 56 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bc05226..648bf3d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2791f63..1475735 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: @@ -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 @@ -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 @@ -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 @@ -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 }} \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 27a5ab7..675d676 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -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: @@ -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