Skip to content

Commit cbe28a0

Browse files
authored
Enable test coverage comparison (#8545)
* Update build_test_deploy.yml * always enable frontend tests on master to upload test coverage artifact * download latest coverage artifact from master branch
1 parent 1a9ee86 commit cbe28a0

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

.github/workflows/build_test_deploy.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,21 @@ jobs:
4040
run: yarn check-cyclic-dependencies
4141
- name: Run frontend tests
4242
run: yarn run vitest run --coverage.enabled true
43-
# - name: Download Coverage Artifacts
44-
# uses: actions/download-artifact@v4
45-
# with:
46-
# name: vitest-coverage-master
47-
# path: coverage
43+
- name: Download Coverage Artifacts
44+
# Can not use actions/download-artifact@v4 because it does not support downloading artifacts from other GA runs
45+
run: |
46+
gh_last_success_run_id=$(gh run list --workflow "CI Pipeline" --json conclusion,headBranch,databaseId --branch master --jq 'first(.[] | select(.conclusion | contains("success"))) | .databaseId')
47+
[ -z "$gh_last_success_run_id" ] && echo "No successful run found" && exit 1 || true
48+
gh run download $gh_last_success_run_id -n $ARTIFACT_NAME -D $OUTPUT_DIR
49+
env:
50+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
ARTIFACT_NAME: vitest-coverage-master
52+
OUTPUT_DIR: coverage-master
4853
- name: 'Report Coverage'
4954
uses: davelosert/vitest-coverage-report-action@v2
5055
with:
5156
comment-on: none # alternative: pr
52-
# json-summary-compare-path: coverage-main/coverage-summary.json
57+
json-summary-compare-path: coverage-master/coverage-summary.json
5358
- name: "Upload Coverage"
5459
if: github.ref == 'refs/heads/master'
5560
uses: actions/upload-artifact@v4

frontend/javascripts/oxalis/view/right-border-tabs/advanced_search_popover.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import ButtonComponent from "oxalis/view/components/button_component";
77
import DomVisibilityObserver from "oxalis/view/components/dom_visibility_observer";
88
import * as React from "react";
99

10-
const PRIMARY_COLOR = "var(--ant-color-primary)";
11-
1210
type Props<S> = {
1311
data: S[];
1412
searchKey: keyof S | ((item: S) => string);
@@ -125,7 +123,7 @@ export default class AdvancedSearchPopover<
125123
color: "red",
126124
}
127125
: {};
128-
const selectAllMatchesButtonColor = areAllMatchesSelected ? PRIMARY_COLOR : undefined;
126+
129127
return (
130128
<React.Fragment>
131129
{provideShortcut ? (
@@ -227,9 +225,8 @@ export default class AdvancedSearchPopover<
227225
<ButtonComponent
228226
style={{
229227
width: 40,
230-
color: selectAllMatchesButtonColor,
231-
borderColor: selectAllMatchesButtonColor,
232228
}}
229+
type={areAllMatchesSelected ? "primary" : "default"}
233230
onClick={
234231
this.props.onSelectAllMatches != null
235232
? () => {

0 commit comments

Comments
 (0)