Skip to content

Commit

Permalink
Merge pull request #13 from MaterializeInc/fix-tests
Browse files Browse the repository at this point in the history
Add CI and fix tests
  • Loading branch information
benesch authored Feb 1, 2022
2 parents f4b5989 + f3d1f4a commit 11b23c3
Show file tree
Hide file tree
Showing 7 changed files with 129 additions and 8 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CI
on:
push:
branches: main
tags: "v*.*.*"
pull_request:

jobs:
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Setup
run: |
pip install dbt-materialize==1.0.1
mkdir -p ~/.dbt
cat > ~/.dbt/profiles.yml <<EOF
config:
send_anonymous_usage_stats: False
use_colors: True
integration_tests:
outputs:
materialize:
type: materialize
threads: 1
host: localhost
port: 6875
user: materialize
password: ignored
dbname: materialize
schema: public
EOF
- name: Test
run: make test-materialize
working-directory: integration_tests/dbt_utils
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')

services:
materialized:
image: materialize/materialized:v0.18.0
ports: ["6875:6875"]
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dbt_packages/
logs/
target/
mzdata/
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# materialize-dbt-utils Changelog

## 0.1.0 - 2021-01-31

* Initial release.
49 changes: 47 additions & 2 deletions MAINTAINER.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,65 @@
# Maintainer instructions

## Bumping dependency versions

To update the tested version of dbt-materialize, bump the version specification
in the `pip install` invocation in [.github/workflows/main.yml].

To update the tested version of `materialized`, bump the version specification
in the `services` specification in [.github/workflows/main.yml].

To update the embedded dbt-utils:

```shell
cd dbt-utils
git checkout main
git pull
cd ..
git commit -am 'Update dbt-utils'
```

We explicitly avoid depending on `latest` so that CI is deterministic. New

## Cutting a new release

1. Check out the latest `main` branch locally.

2. Create an annotated tag for the new version:
2. Bump the version number in [dbt_project.yml].

3. Add an entry for the new version to [CHANGELOG.md].

3. Make a PR with the above changes.

4. Merge the PR to `main`.

5. Pull the new commit locally:

```
git checkout main
git pull
```

6. Verify that you're on the version bump commit:

```
git log
# Make sure most recent commit is your version bump.
```

5. Create an annotated tag for the new version:

```
git tag -a vX.Y.Z -m vX.Y.Z
```

3. Push that tag to GitHub:
6. Push that tag to GitHub:

```
git push vX.Y.Z
```

4. Verify that CI passes on the tag and publishes a GitHub release.

[.github/workflows/main.yml]: .github/workflows/main.yml
[dbt_project.yml]: dbt_project.yml
[CHANGELOG.md]: CHANGELOG.md
2 changes: 1 addition & 1 deletion dbt-utils
Submodule dbt-utils updated 1 files
+23 −10 README.md
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ name: 'materialize_dbt_utils'
version: '0.1.0'
config-version: 2

require-dbt-version: ">=0.18.0"
require-dbt-version: ">=1.0.0"
32 changes: 28 additions & 4 deletions integration_tests/dbt_utils/dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,23 @@ config-version: 2

profile: integration_tests

vars:
dbt_utils_dispatch_list:
- materialize_dbt_utils
- dbt_utils_integration_tests
dispatch:
- macro_namespace: dbt_utils
search_order: [materialize_dbt_utils, dbt_utils_integration_tests, dbt_utils]

seeds:
dbt_utils_integration_tests:
schema_tests:
data_test_mutually_exclusive_ranges_no_gaps:
+enabled: false
data_test_mutually_exclusive_ranges_with_gaps:
+enabled: false
data_test_mutually_exclusive_ranges_with_gaps_zero_length:
+enabled: false
data_test_sequential_timestamps:
+enabled: false
data_test_sequential_values:
+enabled: false

models:
# More info about disabled tests: https://github.com/MaterializeInc/materialize-dbt-utils/issues/7
Expand Down Expand Up @@ -62,7 +75,18 @@ models:
# See: https://github.com/MaterializeInc/materialize/issues/4461
test_surrogate_key:
+enabled: false
test_get_relations_by_pattern:
+enabled: false
test_get_relations_by_prefix_and_union:
+enabled: false
test_get_column_values:
+enabled: false
web:
# TODO for jldlaughlin: triage parse failure
test_url_path:
+enabled: false
geo:
test_haversine_distance_km:
+enabled: false
test_haversine_distance_mi:
+enabled: false

0 comments on commit 11b23c3

Please sign in to comment.