diff --git a/docker-compose.yaml b/docker-compose.yaml index fec8bb5db..1dea794bd 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -196,6 +196,7 @@ services: if [[ "3" == `ls -la ./node_modules/ | wc -l` ]]; then npm install; fi && \ mkdir -p .nyc_output && cp tests/testflows/coverage/raw/* .nyc_output/ && + npx nyc report --reporter=html --report-dir=./tests/testflows/frontend_coverage_testflows cp coverage/coverage-final.json .nyc_output/ && npx nyc report --reporter=html --report-dir=./tests/testflows/coverage ' @@ -216,7 +217,7 @@ services: git config --global --add safe.directory /go/src/grafana-clickhouse && (command -v mage || go install -v github.com/magefile/mage@latest) && mkdir -p /go/src/grafana-clickhouse/coverage/raw && - go test -timeout 1m -cover -failfast -tags=integration -run "${RUN_TESTS:-.+}" -v ./pkg/ -test.gocoverdir="/go/src/grafana-clickhouse/coverage/raw" && + go test -timeout 1m -cover -failfast -tags=integration -run "${RUN_TESTS:-.+}" -v ./pkg/ -test.gocoverdir="/go/src/grafana-clickhouse/coverage" && GOOS=linux GOARCH=amd64 go build -cover -buildvcs=false -o ./dist/altinity-clickhouse-plugin_linux_amd64 ./pkg/ && chmod +x dist/altinity-clickhouse-plugin* " @@ -228,6 +229,11 @@ services: - ./:/go/src/grafana-clickhouse command: | bash -xec " + go tool covdata textfmt -i=coverage/raw -o=coverage/coverage.txt && + go tool cover -html=coverage/coverage.txt -o=coverage/coverage.html && + mkdir -p ./tests/testflows/backend_coverage_testflows/ + mv coverage/coverage.html ./tests/testflows/backend_coverage_testflows/ && + mv coverage/covcounters* coverage/raw/ && go tool covdata textfmt -i=coverage/raw -o=coverage/coverage.txt && go tool cover -html=coverage/coverage.txt -o=coverage/coverage.html " diff --git a/src/views/QueryEditor/QueryEditor.tsx b/src/views/QueryEditor/QueryEditor.tsx index 2c19e7b46..bcd7b20c4 100644 --- a/src/views/QueryEditor/QueryEditor.tsx +++ b/src/views/QueryEditor/QueryEditor.tsx @@ -25,7 +25,7 @@ export function QueryEditor(props: QueryEditorProps onRunQuery(); // @ts-ignore - const adHocFilters = getAdhocFilters(datasource.name, query.datasource.uid) + const adHocFilters = getAdhocFilters(datasource?.name, query.datasource?.uid) const areAdHocFiltersAvailable = !!adHocFilters.length; useEffect(() => { if (props.app !== 'explore') { diff --git a/tests/testflows/infra/create-report.sh b/tests/testflows/infra/create-report.sh index e41531a71..52eaf808f 100755 --- a/tests/testflows/infra/create-report.sh +++ b/tests/testflows/infra/create-report.sh @@ -15,5 +15,8 @@ tfs --debug --no-colors report coverage - ./testflows_logs/raw.log - --confiden mkdir code_coverage mkdir code_coverage/backend mkdir code_coverage/frontend +mkdir ./testflows_logs/frontend cp -rfv coverage/* code_coverage/backend -cp -rfv tests/testflows/coverage/* code_coverage/frontend \ No newline at end of file +cp -rfv tests/testflows/coverage/* code_coverage/frontend +cp -rfv tests/testflows/frontend_coverage_testflows/* ./testflows_logs/frontend +cp -rfv tests/testflows/backend_coverage_testflows/* ./testflows_logs/backend \ No newline at end of file