Actually get buildpulse to work with rspec and jest (#18859)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Mac Siri 2022-12-19 14:31:29 -05:00 committed by GitHub
parent 9fa52753c1
commit f13a1ec0c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 7 deletions

View file

@ -66,7 +66,7 @@ jobs:
with:
account: ${{ secrets.BUILDPULSE_ACCOUNT }}
repository: ${{ secrets.BUILDPULSE_REPOSITORY }}
path: spec/reports
path: tmp/rspec_final_results.xml
key: ${{ secrets.BUILDPULSE_ACCESS_KEY_ID }}
secret: ${{ secrets.BUILDPULSE_SECRET_ACCESS_KEY }}
@ -90,14 +90,14 @@ jobs:
cache: yarn
- run: yarn install --frozen-lockfile
- run: yarn lint:frontend
- run: yarn test --colors
- run: yarn test --colors --ci --reporters=jest-junit
- name: Upload test results to BuildPulse for flaky test detection
if: '!cancelled()' # Run this step even when the tests fail. Skip if the workflow is cancelled.
uses: Workshop64/buildpulse-action@master
with:
account: ${{ secrets.BUILDPULSE_ACCOUNT }}
repository: ${{ secrets.BUILDPULSE_REPOSITORY }}
path: /junit.xml
path: junit.xml
key: ${{ secrets.BUILDPULSE_ACCESS_KEY_ID }}
secret: ${{ secrets.BUILDPULSE_SECRET_ACCESS_KEY }}
- uses: codecov/codecov-action@v3

1
.rspec
View file

@ -2,4 +2,3 @@
--format progress
--require spec_helper
--format RspecJunitFormatter
--out spec/reports/rspec.xml

View file

@ -279,7 +279,7 @@ export const ImageUploader = ({
// Cleanup afterwards
return () =>
document.removeEventListener('ForemMobile', handleNativeMessage);
}, []);
});
const [state, dispatch] = useReducer(imageUploaderReducer, {
insertionImageUrls: [],

View file

@ -3,7 +3,7 @@ if [ "$KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC" = "" ]; then
KNAPSACK_PRO_ENDPOINT=https://api-disabled-for-fork.knapsackpro.com \
KNAPSACK_PRO_MAX_REQUEST_RETRIES=0 \
KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC=disabled-for-fork \
bundle exec rake knapsack_pro:rspec # use Regular Mode here always
bundle exec rake "knapsack_pro:rspec[--format documentation --format RspecJunitFormatter --out tmp/rspec.xml]"
else
bundle exec rake knapsack_pro:queue:rspec
bundle exec rake "knapsack_pro:queue:rspec[--format documentation --format RspecJunitFormatter --out tmp/rspec.xml]"
fi

View file

@ -9,6 +9,15 @@ KnapsackPro::Hooks::Queue.before_queue do |_queue_id|
SimpleCov.command_name("rspec_ci_node_#{KnapsackPro::Config::Env.ci_node_index}")
end
TMP_RSPEC_XML_REPORT = "tmp/rspec.xml".freeze
FINAL_RSPEC_XML_REPORT = "tmp/rspec_final_results.xml".freeze
KnapsackPro::Hooks::Queue.after_subset_queue do |_queue_id, _subset_queue_id|
if File.exist?(TMP_RSPEC_XML_REPORT)
FileUtils.mv(TMP_RSPEC_XML_REPORT, FINAL_RSPEC_XML_REPORT)
end
end
require "spec_helper"
require File.expand_path("../config/environment", __dir__)