Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add clearer directions for custom test suite vars in Makefile. #6764

Merged
merged 8 commits into from
Jan 31, 2023
6 changes: 6 additions & 0 deletions .changes/unreleased/Features-20230126-154716.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Features
body: Adjust makefile to have clearer instructions for CI env var changes.
time: 2023-01-26T15:47:16.887327-08:00
custom:
Author: versusfacit
Issue: "6689"
26 changes: 20 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,31 @@ endif

LOGS_DIR := ./logs
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Collapsed this variable into the LOG_DIR variable used in our CI


# Optional flag to invoke tests using our CI env.
# But we always want these active for structured
# log testing.
CI_FLAGS =\
# Flags that dbt Labs uses in our CI env. To override
# these, preface the `make` command on your command
# line with USE_DEFAULT_CI_FLAGS=false. Then, uncomment
# the CUSTOM_CI_FLAGS variable and fill with values that
# fit your test suite's needs.
USE_DEFAULT_CI_FLAGS ?= true

DEFAULT_CI_FLAGS =\
DBT_TEST_USER_1=dbt_test_user_1\
DBT_TEST_USER_2=dbt_test_user_2\
DBT_TEST_USER_3=dbt_test_user_3\
RUSTFLAGS="-D warnings"\
LOG_DIR=./logs\
DBT_LOG_FORMAT=json

# CUSTOM_CI_FLAGS =\
DBT_TEST_USER_1=\
DBT_TEST_USER_2=\
DBT_TEST_USER_3=\
RUSTFLAGS=\
LOG_DIR=\
DBT_LOG_FORMAT=



.PHONY: dev_req
dev_req: ## Installs dbt-* packages in develop mode along with only development dependencies.
@\
Expand Down Expand Up @@ -66,7 +80,7 @@ test: .env ## Runs unit tests with py and code checks against staged changes.
.PHONY: integration
integration: .env ## Runs postgres integration tests with py-integration
@\
$(if $(USE_CI_FLAGS), $(CI_FLAGS)) $(DOCKER_CMD) tox -e py-integration -- -nauto
$(if $(filter true,$(USE_DEFAULT_CI_FLAGS)), $(DEFAULT_CI_FLAGS), $(CUSTOM_CI_FLAGS)) $(DOCKER_CMD) tox -e py-integration -- -nauto

.PHONY: integration-fail-fast
integration-fail-fast: .env ## Runs postgres integration tests with py-integration in "fail fast" mode.
Expand All @@ -77,7 +91,7 @@ integration-fail-fast: .env ## Runs postgres integration tests with py-integrati
interop: clean
@\
mkdir $(LOGS_DIR) && \
$(CI_FLAGS) $(DOCKER_CMD) tox -e py-integration -- -nauto && \
$(DEFAULT_CI_FLAGS) $(DOCKER_CMD) tox -e py-integration -- -nauto && \
LOG_DIR=$(LOGS_DIR) cargo run --manifest-path test/interop/log_parsing/Cargo.toml

.PHONY: setup-db
Expand Down