Skip to content

Commit

Permalink
Fixing requirements, merging coverage from unit and integration tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
antip00 committed Nov 18, 2024
1 parent e32a930 commit a39e642
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
5 changes: 4 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ services:
npm run create_instrumented &&
cp -R -n src/* instrumented/ &&
npm run build:test
npm run test:coverage
'
frontend_coverage_generate:
Expand All @@ -193,7 +194,8 @@ services:
bash -xec '
if [[ "3" == `ls -la ./node_modules/ | wc -l` ]]; then npm install; fi && \
mkdir -p .nyc_output &&
cp tests/testflows/coverage/raw/* .nyc_output/
cp tests/testflows/coverage/raw/* .nyc_output/ &&
cp coverage/coverage-final.json .nyc_output/ &&
npx nyc report --reporter=html --report-dir=./tests/testflows/coverage
'
Expand All @@ -212,6 +214,7 @@ services:
bash -xec "
git config --global --add safe.directory /go/src/grafana-clickhouse &&
(command -v mage || go install -v github.com/magefile/mage@latest) &&
go test -timeout 1m -cover -failfast -tags=integration -run "${RUN_TESTS:-.+}" -v ./pkg/ -test.gocoverdir="/go/src/grafana-clickhouse/coverage/raw" &&
GOOS=linux GOARCH=amd64 go build -cover -buildvcs=false -o ./dist/altinity-clickhouse-plugin_linux_amd64 ./pkg/ &&
chmod +x dist/altinity-clickhouse-plugin*
"
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"build": "webpack -c ./.config/webpack/webpack.config.ts --env production",
"dev": "webpack -w -c ./.config/webpack/webpack.config.ts --env development",
"test": "jest",
"test:coverage ": "jest --coverage",
"test:ci": "jest --passWithNoTests --maxWorkers 4",
"typecheck": "tsc --noEmit",
"lint": "eslint --cache --ignore-path ./.gitignore --ext .js,.jsx,.ts,.tsx .",
Expand Down
4 changes: 3 additions & 1 deletion tests/testflows/tests/automated/data_source_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,8 +541,10 @@ def check_default_values_datetime64(self):
RQ_SRS_Plugin_DataSourceSetupView("1.0"),
RQ_SRS_Plugin_DataSourceSetupView_DataSourceName("1.0"),
RQ_SRS_Plugin_DataSourceSetupView_SaveAndTestButton("1.0"),
RQ_SRS_Plugin_Dashboards("1.0"),
RQ_SRS_Plugin_Panels("1.0"),
RQ_SRS_Plugin_DataSourceSetupView_HTTPConnection_ServerAccess("1.0")
RQ_SRS_Plugin_DataSourceSetupView_HTTPConnection_ServerAccess("1.0"),
RQ_SRS_Plugin_DataSourceSetupView_HTTPConnection("1.0"),
)
@Name("data source setup")
def feature(self):
Expand Down
3 changes: 2 additions & 1 deletion tests/testflows/tests/automated/query_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ def max_data_points(self):


@TestScenario
@Requirements(RQ_SRS_Plugin_QueryOptions_MinInterval("1.0"))
@Requirements(RQ_SRS_Plugin_QueryOptions_MinInterval("1.0"),
RQ_SRS_Plugin_QueryOptions_Interval("1.0"))
def min_interval(self):
"""Check that grafana plugin supports specifying 'Min interval' textfield."""

Expand Down
10 changes: 8 additions & 2 deletions tests/testflows/tests/automated/sql_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,6 @@ def extrapolation_toggle(self):


@TestOutline
@Requirements(RQ_SRS_Plugin_RawSQLEditorInterface_SkipComments("1.0"))
def skip_comments_toggle(self, query):
"""Check that grafana plugin supports Skip Comments toggle."""

Expand Down Expand Up @@ -369,6 +368,7 @@ def skip_comments_toggle(self, query):


@TestScenario
@Requirements(RQ_SRS_Plugin_RawSQLEditorInterface_SkipComments("1.0"))
def multiline_comment(self):
"""Check that grafana plugin supports Skip Comments toggle with multiline comments."""

Expand All @@ -380,6 +380,7 @@ def multiline_comment(self):


@TestScenario
@Requirements(RQ_SRS_Plugin_RawSQLEditorInterface_SkipComments("1.0"))
def double_dash_comment(self):
"""Check that grafana plugin supports Skip Comments toggle with multiline comments."""

Expand All @@ -391,6 +392,7 @@ def double_dash_comment(self):


@TestScenario
@Requirements(RQ_SRS_Plugin_RawSQLEditorInterface_SkipComments("1.0"))
def hash_comment(self):
"""Check that grafana plugin supports Skip Comments toggle with multiline comments."""

Expand All @@ -402,6 +404,7 @@ def hash_comment(self):


@TestScenario
@Requirements(RQ_SRS_Plugin_RawSQLEditorInterface_SkipComments("1.0"))
def hash_exclamation_comment(self):
"""Check that grafana plugin supports Skip Comments toggle with multiline comments."""

Expand All @@ -415,7 +418,10 @@ def hash_exclamation_comment(self):
@TestFeature
@Requirements(
RQ_SRS_Plugin_RawSQLEditorInterface("1.0"),
RQ_SRS_Plugin_RawSQLEditorInterface_ShowGeneratedSQL("1.0")
RQ_SRS_Plugin_RawSQLEditorInterface_ShowGeneratedSQL("1.0"),
RQ_SRS_Plugin_QuerySetup("1.0"),
RQ_SRS_Plugin_QuerySettings("1.0"),
RQ_SRS_Plugin_RawSQLEditorInterface_SQLEditor("1.0")
)
@Name("sql editor")
def feature(self):
Expand Down

0 comments on commit a39e642

Please sign in to comment.