Skip to content

Commit

Permalink
Updated coverage; separate svg err msg in UI
Browse files Browse the repository at this point in the history
  • Loading branch information
KH committed Dec 13, 2024
1 parent 0c8b6e3 commit ae21a4d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@ jobs:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: goveralls -coverprofile=/var/tmp/capillaries.p -service=github

- name: pkg/capigraph test coverage threshold check
env:
TESTCOVERAGE_THRESHOLD: 93.9
run: |
go test -v ./pkg/capigraph/... -coverprofile coverage.out -covermode count
totalCoverage=`go tool cover -func=coverage.out | grep total | grep -Eo '[0-9]+\.[0-9]+'`
if (( $(echo "$totalCoverage $TESTCOVERAGE_THRESHOLD" | awk '{print ($1 >= $2)}') )); then
echo -e "\033[32mOK: $totalCoverage >= $TESTCOVERAGE_THRESHOLD\033[0m"
else
echo -e "\033[31mFAILED: $totalCoverage < $TESTCOVERAGE_THRESHOLD. Cover more with unit tests or adjust threshold to a lower value.\033[0m"
exit 1
fi
- name: pkg/cql test coverage threshold check
env:
TESTCOVERAGE_THRESHOLD: 87.6
Expand Down
4 changes: 3 additions & 1 deletion ui/src/routes/KsMatrix.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
let breadcrumbsPathElements = $state([]);
let svgScriptViz = $state('');
let svgError = $state('');
let webapiData = $state({ run_lifespans: [], nodes: [] });
let responseError = $state('');
var timer;
Expand Down Expand Up @@ -86,7 +87,7 @@
svgScriptViz = responseText;
})
.catch((error) => {
responseError =
svgError =
'cannot fetch SVG viz from Capillaries webapi at ' +
method +
' ' +
Expand Down Expand Up @@ -209,6 +210,7 @@
{/snippet}

{#snippet tabViz()}
<p style="color:red;">{svgError}</p>
{#if webapiData.run_lifespans.length > 0}
<p>
This diagram is static. To see it in a separate window, click <a
Expand Down
5 changes: 4 additions & 1 deletion ui/src/routes/KsRunNodeHistory.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
let webapiData = $state({ run_props: {}, run_lifespan: {}, node_history: [] });
let responseError = $state('');
let svgStatusViz = $state('');
let svgError = $state('');
function calculateElapsed(node_history) {
let earliestTs = null;
Expand Down Expand Up @@ -163,7 +164,7 @@
}
})
.catch((error) => {
responseError =
svgError =
'cannot fetch SVG status viz from Capillaries webapi at ' +
method +
' ' +
Expand Down Expand Up @@ -230,6 +231,8 @@
or <a target="_blank" href={scriptVizUrl(ks_name, run_id, true)}>here</a> for colored by root node.
</p>

<p style="color:red;">{svgError}</p>

<div style="width:100%">
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
{@html svgStatusViz}
Expand Down

0 comments on commit ae21a4d

Please sign in to comment.