Skip to content

Commit

Permalink
Merge pull request #70 from keboola/adamvyborny-DBT-15-build-step
Browse files Browse the repository at this point in the history
dbt build step
  • Loading branch information
AdamVyborny authored Nov 3, 2022
2 parents cc43707 + 6538f00 commit 937658a
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/Configuration/NodeDefinition/DbtNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class DbtNode extends ArrayNodeDefinition
public const NODE_NAME = 'dbt';

private const ACCEPTED_DBT_COMMANDS = [
DbtService::COMMAND_BUILD,
DbtService::COMMAND_RUN,
DbtService::COMMAND_DOCS_GENERATE,
DbtService::COMMAND_TEST,
Expand Down
1 change: 1 addition & 0 deletions src/Service/DbtService.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

class DbtService
{
public const COMMAND_BUILD = 'dbt build';
public const COMMAND_COMPILE = 'dbt compile';
public const COMMAND_DOCS_GENERATE = 'dbt docs generate';
public const COMMAND_DEBUG = 'dbt debug';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,24 @@ Successfully cloned repository https://github.com/keboola/dbt-test-project-publi
Executing command "dbt deps"
Running with dbt=%s
Warning: No packages were found in packages.yml
Executing command "dbt run"
Executing command "dbt build"
Running with dbt=%s
Partial parse save file not found. Starting full parse.
Found 2 models, 2 tests, 0 snapshots, 0 analyses, 267 macros, 0 operations, 0 seed files, 2 sources, 0 exposures, 0 metrics
Concurrency: 1 threads (target='kbc_prod')
1 of 4 START test source_not_null_in.c-test-bucket_test__id_ ................... [RUN]
1 of 4 PASS source_not_null_in.c-test-bucket_test__id_ ......................... [PASS in %ss]
2 of 4 START test source_unique_in.c-test-bucket_test__id_ ..................... [RUN]
2 of 4 PASS source_unique_in.c-test-bucket_test__id_ ........................... [PASS in %ss]
3 of 4 START view model WORKSPACE_875822722.stg_model .......................... [RUN]
3 of 4 OK created view model WORKSPACE_875822722.stg_model ..................... [SUCCESS 1 in %ss]
4 of 4 START view model WORKSPACE_875822722.fct_model .......................... [RUN]
4 of 4 OK created view model WORKSPACE_875822722.fct_model ..................... [SUCCESS 1 in %ss]
Finished running 2 tests, 2 view models in %s hours %s minutes and %s seconds (%ss).
Completed successfully
Done. PASS=4 WARN=0 ERROR=0 SKIP=0 TOTAL=4
Executing command "dbt run"
Running with dbt=%s
Found 2 models, 2 tests, 0 snapshots, 0 analyses, %s macros, 0 operations, 0 seed files, 2 sources, 0 exposures, 0 metrics
Concurrency: 1 threads (target='kbc_prod')
1 of 2 START view model %s.stg_model %s [RUN]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"repo": "https://github.com/keboola/dbt-test-project-public.git"
},
"dbt": {
"executeSteps": ["dbt run", "dbt docs generate", "dbt test", "dbt source freshness"],
"executeSteps": ["dbt build", "dbt run", "dbt docs generate", "dbt test", "dbt source freshness"],
"threads": 1,
"freshness": {
"warn_after": {"active": true, "count": 1, "period": "day"}
Expand Down
4 changes: 2 additions & 2 deletions tests/phpunit/ConfigDefinition/ConfigDefinitionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,8 @@ public function invalidConfigsData(): Generator
],
],
'expectedError' => 'The value "dbt do nothing" is not allowed for path ' .
'"root.parameters.dbt.executeSteps.0". Permissible values: "dbt run", "dbt docs generate", ' .
'"dbt test", "dbt source freshness"',
'"root.parameters.dbt.executeSteps.0". Permissible values: "dbt build", "dbt run", ' .
'"dbt docs generate", "dbt test", "dbt source freshness"',
];

yield 'config with remote DWH non-supported type' => [
Expand Down

0 comments on commit 937658a

Please sign in to comment.