### Replace setup-go with buildpulse/setup-go Source: https://docs.buildpulse.io/runners/toolkit/artifact-cache Use the optimized BuildPulse setup action for Go to leverage improved caching performance. ```yaml name: Setup Go - uses: actions/setup-go@v5 + uses: buildpulse/setup-go@v5 with: go-version: '>=1.17.0' ``` -------------------------------- ### Install and Use gotestsum in CI Workflow Source: https://docs.buildpulse.io/Guides/Test%20Frameworks/Go Update your CI workflow to install gotestsum, create a directory for JUnit XML files, and then use gotestsum to run your test suite. This replaces the standard 'go test' command. ```yaml jobs: with: go-version: '1.16' + - name: Set up gotestsum + run: | + go install gotest.tools/gotestsum@latest // or go get module dependency + - name: Run tests run: | - go test ./... + mkdir -p tmp/test-results + gotestsum --junitfile tmp/test-results/gotestsum-report.xml ./... ``` -------------------------------- ### Install Mocha Reporters Source: https://docs.buildpulse.io/Guides/Test%20Frameworks/Mocha Add the required JUnit and multi-reporter packages as development dependencies. ```bash npm install --save-dev mocha-junit-reporter mocha-multi-reporters ``` -------------------------------- ### Install jest-junit dependency Source: https://docs.buildpulse.io/Guides/Test%20Frameworks/Jest Add the jest-junit package as a development dependency to your project. ```bash npm install --save-dev jest-junit ``` -------------------------------- ### Reference Builder Name Output Source: https://docs.buildpulse.io/runners/toolkit/docker-build-cache Access the builder name generated by the setup action for use in subsequent build scripts. ```yaml ${{ steps.setup_builder.outputs.name }} ``` -------------------------------- ### Get Docker Builder Name Output Source: https://docs.buildpulse.io/runners/quickstart Retrieve the builder name output from the `buildpulse/setup-buildx-action` to configure your Docker build scripts. ```bash ${{ steps.setup_builder.outputs.name }} ``` -------------------------------- ### Sample Quarantine API Response Source: https://docs.buildpulse.io/flaky-tests/guides/Test%20Quarantining This is an example of the JSON response structure when querying the BuildPulse Quarantine API for flaky tests. It includes details about the test, its suite, class, file, and disruptor type. ```json { "count": 1, "tests": [ { "id": 434140152, "name": "System Posts Lifecycle Basic posts flow can edit a post", "suite": "rspec", "class": "spec.system.posts_lifecycle_spec", "file": "./spec/system/posts_lifecycle_spec.rb" "disruptor_type": "default" } ], "metadata": { "after": null, "limit": 25 } } ``` -------------------------------- ### GET /v1/flaky/tests Source: https://docs.buildpulse.io/flaky-tests/guides/Test%20Quarantining Retrieves a list of flaky tests that are currently quarantined or identified as flaky based on repository settings. ```APIDOC ## GET https://api.buildpulse.io/v1/flaky/tests ### Description Retrieves a list of flaky tests for a specific repository. Use this endpoint to identify tests that should be skipped or disabled in your test suite. ### Method GET ### Endpoint https://api.buildpulse.io/v1/flaky/tests ### Parameters #### Query Parameters - **repository** (string) - Required (or repository_id) - The name of your repository/project. - **repository_id** (string) - Required (or repository) - The ID of your repository/project. - **quarantine** (boolean) - Optional - Set to false to return all flaky tests. Default is true. - **include** (string) - Optional - Expand flaky test attributes. Supported values: tags, disruptiveness_ratio, nondeterministic_negative_result_count, quarantine_date, quarantine_type, time_consumed (microseconds), quarantined_by, issue_url, git_owners. - **after** (string) - Optional - Pagination key. ### Response #### Success Response (200) - **count** (integer) - Total number of tests returned. - **tests** (array) - List of flaky test objects. - **metadata** (object) - Pagination and limit information. #### Response Example { "count": 1, "tests": [ { "id": 434140152, "name": "System Posts Lifecycle Basic posts flow can edit a post", "suite": "rspec", "class": "spec.system.posts_lifecycle_spec", "file": "./spec/system/posts_lifecycle_spec.rb", "disruptor_type": "default" } ], "metadata": { "after": null, "limit": 25 } } ``` -------------------------------- ### Configure BuildPulse Docker Buildx Action Source: https://docs.buildpulse.io/runners/toolkit/docker-build-cache Replace the standard Docker setup-buildx-action with the BuildPulse version to enable incremental builds. ```yaml name: Configure Docker Buildx builder - uses: docker/setup-buildx-action@v3 + uses: buildpulse/setup-buildx-action@v3 id: setup_builder ``` -------------------------------- ### Configure Docker Buildx builder Source: https://docs.buildpulse.io/runners/toolkit/remote-docker-builders Update your GitHub Actions workflow to use the BuildPulse setup-buildx-action. ```yaml name: Configure Docker Buildx builder - uses: docker/setup-buildx-action@v3 + uses: buildpulse/setup-buildx-action@v3 id: setup_builder with: buildpulse-builder: bp-docker-builder-x64-32x ``` -------------------------------- ### Create Reporter Configuration Source: https://docs.buildpulse.io/Guides/Test%20Frameworks/Mocha Define the reporter configuration file to enable both the spec and JUnit reporters. ```json +{ + "reporterEnabled": "spec, mocha-junit-reporter" +} ``` -------------------------------- ### Enable BuildPulse Docker Build Cache Source: https://docs.buildpulse.io/runners/quickstart Replace the `docker/setup-buildx-action` with `buildpulse/setup-buildx-action` to enable Docker layer caching. This speeds up subsequent builds by reusing cached image layers. ```yaml name: Configure Docker Buildx builder - uses: docker/setup-buildx-action@v3 + uses: buildpulse/setup-buildx-action@v3 id: setup_builder ``` -------------------------------- ### Execute multi-platform Docker builds Source: https://docs.buildpulse.io/runners/toolkit/remote-docker-builders Use native hardware for different architectures by configuring separate builders in your workflow matrix. ```yaml jobs: build: runs-on: bp-ubuntu-latest-x64-4x steps: - name: Checkout uses: actions/checkout@v3 - uses: buildpulse/setup-buildx-action@v3 id: setup_x64_builder with: buildpulse-builder: bp-docker-builder-x64-32x - uses: buildpulse/setup-buildx-action@v3 id: setup_arm64_builder with: buildpulse-builder: bp-docker-builder-arm64-32x - name: Build amd64 image uses: buildpulse/build-push-action@v6 with: push: true tags: user/app:amd64 platform: amd64 builder: ${{ steps.setup_x64_builder.outputs.name }} - name: Build arm64 image uses: buildpulse/build-push-action@v6 with: push: true tags: user/app:arm64 platform: arm64 builder: ${{ steps.setup_arm64_builder.outputs.name }} ``` -------------------------------- ### Configure BuildPulse Build and Push Action Source: https://docs.buildpulse.io/runners/toolkit/docker-build-cache Replace the standard docker/build-push-action with the BuildPulse version to leverage the co-located build cache. ```yaml name: Build and push docker image - uses: docker/build-push-action@v6 + uses: buildpulse/build-push-action@v6 with: tags: org/app:latest ``` -------------------------------- ### Use BuildPulse Docker Build Push Action Source: https://docs.buildpulse.io/runners/quickstart Replace the `docker/build-push-action` with `buildpulse/build-push-action` to leverage BuildPulse's Docker layer caching for incremental builds. ```yaml name: Build and push docker image - uses: docker/build-push-action@v6 + uses: buildpulse/build-push-action@v6 with: tags: org/app:latest ``` -------------------------------- ### Commit changes Source: https://docs.buildpulse.io/Guides/Test%20Frameworks/Jest Use the git CLI to commit the configuration changes to your repository. ```bash git commit -am "Update CI to generate JUnit XML for test results" ``` -------------------------------- ### Submit Test Results via BuildPulse Test Reporter Source: https://docs.buildpulse.io/Guides/CI%20Providers/Other%20CI%20Providers Execute the test reporter with required environment variables and command-line arguments to submit build data. ```bash BUILDPULSE_ACCESS_KEY_ID=$INPUT_KEY \ BUILDPULSE_SECRET_ACCESS_KEY=$INPUT_SECRET \ GIT_COMMIT=$GIT_COMMIT \ GIT_BRANCH=$GIT_BRANCH \ BUILD_URL=$BUILD_URL \ ORGANIZATION_NAME=$ORGANIZATION_NAME \ REPOSITORY_NAME=$REPOSITORY_NAME \ ./buildpulse-test-reporter submit $REPORT_PATH --account-id $ACCOUNT_ID --repository-id $REPOSITORY_ID --repository-dir $REPOSITORY_PATH ``` -------------------------------- ### Add minitest-ci dependency Source: https://docs.buildpulse.io/Guides/Test%20Frameworks/Minitest Use bundle to add the minitest-ci gem to your project. ```bash bundle add minitest-ci ``` -------------------------------- ### Verify Gemfile dependency Source: https://docs.buildpulse.io/Guides/Test%20Frameworks/Minitest Ensure the minitest-ci gem is present in your Gemfile. ```ruby ruby '2.7.4' gem 'minitest' +gem 'minitest-ci' gem 'rake' ``` -------------------------------- ### Configure CircleCI with BuildPulse Orb Source: https://docs.buildpulse.io/Guides/CI%20Providers/CircleCI Update your .circleci/config.yml to include the BuildPulse orb and specify your account and repository IDs. This enables sending test results to BuildPulse. ```yaml account-id: 46661156 repository-id: 382123152 ``` -------------------------------- ### Integrate BuildPulse BitBucket Pipe Source: https://docs.buildpulse.io/Guides/CI%20Providers/BitBucket%20Pipelines Add the BuildPulse pipe to your BitBucket Pipeline configuration. The test-reporter is run in an after-script to ensure results are sent even if tests fail. ```yaml after-script: - pipe: docker://buildpulseapp/buildpulse-pipe variables: ACCOUNT: $BUILDPULSE_ACCOUNT_ID REPOSITORY: $BUILDPULSE_REPOSITORY_ID REPORT_PATHS: spec/reports KEY: $BUILDPULSE_ACCESS_KEY_ID SECRET: $BUILDPULSE_SECRET_ACCESS_KEY ``` -------------------------------- ### Commit Changes Source: https://docs.buildpulse.io/Guides/Test%20Frameworks/RSpec Commit the configuration changes to your Git repository. ```git git commit -am "Generate test reports with rspec_junit_formatter" ``` -------------------------------- ### Replace actions/cache with buildpulse/cache Source: https://docs.buildpulse.io/runners/toolkit/artifact-cache Update your workflow YAML to use the BuildPulse cache action instead of the standard GitHub cache action. ```yaml name: Cache dependencies - uses: actions/cache@v4 + uses: buildpulse/cache@v4 with: key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} path: ./node_modules ``` -------------------------------- ### Update package.json Dependencies Source: https://docs.buildpulse.io/Guides/Test%20Frameworks/Mocha Verify the addition of mocha-junit-reporter and mocha-multi-reporters to the devDependencies section. ```json "author": "Richard Hendricks", "license": "MIT", "devDependencies": { - "mocha": "^9.1.1" + "mocha": "^9.1.1", + "mocha-junit-reporter": "^2.0.0", + "mocha-multi-reporters": "^1.5.1" } } ``` -------------------------------- ### Integrate BuildPulse Artifact Cache Source: https://docs.buildpulse.io/runners/quickstart Switch from the standard GitHub Actions cache to BuildPulse's artifact cache for faster job execution. This action is co-located with runners and offers advanced compression. ```yaml name: Cache Node Modules - uses: actions/cache@v4 + uses: buildpulse/cache@v4 with: key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} path: ./node_modules ``` -------------------------------- ### Set BuildPulse Environment Variables Source: https://docs.buildpulse.io/Guides/CI%20Providers/CircleCI Add these environment variables to your CircleCI project settings. Ensure you replace placeholder values with your actual BuildPulse credentials. ```yaml BUILDPULSE_ACCESS_KEY_ID AKIA3SYVRUSERHR2LCNK BUILDPULSE_SECRET_ACCESS_KEY ******** ``` -------------------------------- ### BuildPulse Credentials Source: https://docs.buildpulse.io/Guides/CI%20Providers/BitBucket%20Pipelines These are the BuildPulse credentials and repository IDs required for integration. Add them to your BitBucket Workspace variables. ```yaml BUILDPULSE_ACCESS_KEY_ID AKIA3SYVRUSERHR2LCNK BUILDPULSE_SECRET_ACCESS_KEY ******** account: 46661156 repository: 382123152 ``` -------------------------------- ### BuildPulse Credentials Source: https://docs.buildpulse.io/Guides/CI%20Providers/Travis%20CI Required access keys for authenticating the BuildPulse Test Reporter. ```text BUILDPULSE_ACCESS_KEY_ID AKIA3SYVRUSERHR2LCNK BUILDPULSE_SECRET_ACCESS_KEY ******** ``` -------------------------------- ### Query Flaky Tests API Source: https://docs.buildpulse.io/flaky-tests/guides/Test%20Quarantining Use this endpoint to retrieve a list of flaky tests. Ensure you have a valid API key and specify the repository. The `quarantine=false` parameter retrieves all flaky tests, not just quarantined ones. ```bash curl -X GET \ 'https://api.buildpulse.io/v1/flaky/tests?repository=my-repo&quarantine=false&include=tags,disruptiveness_ratio' \ -H 'Authorization: Bearer ${BUILDPULSE_API_KEY}' ``` -------------------------------- ### Configure pytest.ini Source: https://docs.buildpulse.io/Guides/Test%20Frameworks/Pytest Set the junit_family to xunit2 to ensure compatibility with standard JUnit XML reporting. ```ini +[pytest] +junit_family=xunit2 ``` -------------------------------- ### Configure Cypress to Output JUnit XML Reports Source: https://docs.buildpulse.io/Guides/Test%20Frameworks/Cypress Update your CI workflow to include the junit reporter and specify the output path for the XML reports. This ensures test results are generated in a machine-readable format. ```yaml blocks: - checkout - sem-version node 12 - npm install - - npx cypress run + - npx cypress run --reporter junit --reporter-options "mochaFile=cypress/results/results-[hash].xml" ``` -------------------------------- ### Update CI Workflow Command Source: https://docs.buildpulse.io/Guides/Test%20Frameworks/Pytest Compare the standard test execution command with the version that generates a JUnit XML report. ```bash pipenv run pytest ``` ```bash pipenv run pytest --junitxml=junit.xml ``` -------------------------------- ### Configure .rspec for JUnit XML Output Source: https://docs.buildpulse.io/Guides/Test%20Frameworks/RSpec Modify your `.rspec` file to use the `RspecJunitFormatter` and specify the output path for the XML report. ```bash --require spec_helper --format progress +--format RspecJunitFormatter +--out spec/reports/rspec.xml ``` -------------------------------- ### Configure CI Workflow for JUnit XML Output Source: https://docs.buildpulse.io/Guides/Test%20Frameworks/PHPUnit Update your CI script to include the `--log-junit` option when running PHPUnit. This generates a `junit.xml` file at the project root, detailing test results. ```yaml jobs: run: composer install --prefer-dist --no-progress - name: Run test suite run: vendor/bin/phpunit ./tests --log-junit junit.xml ``` -------------------------------- ### Add rspec_junit_formatter Dependency Source: https://docs.buildpulse.io/Guides/Test%20Frameworks/RSpec Use `bundle add` to include the `rspec_junit_formatter` gem in your project's Gemfile. ```ruby bundle add rspec_junit_formatter ``` ```ruby source 'https://rubygems.org' ruby '2.6.6' gem 'rspec' +gem 'rspec_junit_formatter' ``` -------------------------------- ### Update .gitignore Source: https://docs.buildpulse.io/Guides/Test%20Frameworks/Jest Exclude the generated junit.xml file from version control. ```diff @@ -1 +1,2 @@ +/junit.xml /node_modules ``` -------------------------------- ### Update CI Workflow Source: https://docs.buildpulse.io/Guides/Test%20Frameworks/Mocha Modify the test command in the CI configuration to use the multi-reporter and the custom configuration file. ```yaml jobs: - run: npm ci - - run: npm test + - run: npm test -- --reporter mocha-multi-reporters --reporter-options configFile=mocha-reporter-config.json ``` -------------------------------- ### BuildPulse Repository Identifiers Source: https://docs.buildpulse.io/Guides/CI%20Providers/Travis%20CI Unique identifiers for the BuildPulse account and repository. ```text Account ID: 46661156 Repository ID: 382123152 ``` -------------------------------- ### Configure jest-junit reporter Source: https://docs.buildpulse.io/Guides/Test%20Frameworks/Jest Modify jest.config.js to include the jest-junit reporter alongside the default reporter. ```javascript module.exports = { - reporters: [ "default" ] + "reporters": [ + "default", + ["jest-junit", { + addFileAttribute: "true", + ancestorSeparator: " › ", + classNameTemplate: "{classname}", + titleTemplate: "{title}", // outputname + }] + ] }; ``` -------------------------------- ### Update GitHub Actions Runner Tag Source: https://docs.buildpulse.io/runners/quickstart Replace the default GitHub runner tag with a BuildPulse runner tag in your workflow files. Ensure the tag matches your desired configuration (vCPUs and architecture). ```yaml jobs: build: - runs-on: ubuntu-latest + runs-on: bp-ubuntu-latest-x64-4x ``` -------------------------------- ### Require minitest/ci in test helper Source: https://docs.buildpulse.io/Guides/Test%20Frameworks/Minitest Update your test helper to include the minitest/ci requirement. ```ruby require 'minitest/autorun' +require 'minitest/ci' ``` -------------------------------- ### Update package.json dependencies Source: https://docs.buildpulse.io/Guides/Test%20Frameworks/Jest Verify the addition of jest-junit to the devDependencies section of your package.json file. ```json "author": "Richard Hendricks", "license": "MIT", "devDependencies": { - "jest": "^26.6.3" + "jest": "^26.6.3", + "jest-junit": "^12.0.0" } ``` -------------------------------- ### Update .gitignore Source: https://docs.buildpulse.io/Guides/Test%20Frameworks/Mocha Exclude the generated test results file from version control. ```text /node_modules +/test-results.xml ``` -------------------------------- ### Update .gitignore for reports Source: https://docs.buildpulse.io/Guides/Test%20Frameworks/Minitest Exclude the generated test reports directory from version control. ```text /.bundle +/test/reports ``` -------------------------------- ### Ignore JUnit Reports in Git Source: https://docs.buildpulse.io/Guides/Test%20Frameworks/RSpec Add the report directory to your `.gitignore` file to prevent accidental commits of generated test reports. ```gitignore /.bundle +/spec/reports ``` -------------------------------- ### Commit CI Configuration Changes Source: https://docs.buildpulse.io/Guides/Test%20Frameworks/Cypress Commit the changes made to your CI workflow file to your Git repository. This ensures the new reporting configuration is saved and deployed. ```git git commit -am "Update CI to generate JUnit XML for test results" ``` -------------------------------- ### Commit CI Changes Source: https://docs.buildpulse.io/Guides/Test%20Frameworks/Go Commit the changes made to your CI workflow file to your Git repository. This ensures the new test reporting configuration is saved. ```bash git commit -am "Update CI to generate JUnit XML for test results" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.