Skip to content

Commit

Permalink
Make integration tests runnable (databricks#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
nfx authored Mar 22, 2023
1 parent f690749 commit abab568
Show file tree
Hide file tree
Showing 30 changed files with 1,069 additions and 894 deletions.
2 changes: 1 addition & 1 deletion .codegen/service.py.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class {{.PascalName}}{{if eq "List" .PascalName}}Request{{end}}:{{if .Descriptio
{{- define "from_dict_type" -}}
{{- if not .Entity }}None
{{- else if .Entity.ArrayValue }}{{if .Entity.ArrayValue.IsObject}}[{{.Entity.ArrayValue.PascalName}}.from_dict(v) for v in d['{{.Name}}']] if '{{.Name}}' in d and d['{{.Name}}'] is not None else None{{else}}d.get('{{.Name}}', None){{end}}
{{- else if or .Entity.IsObject .Entity.IsExternal }}{{.Entity.PascalName}}.from_dict(d['{{.Name}}']) if '{{.Name}}' in d else None
{{- else if or .Entity.IsObject .Entity.IsExternal }}{{.Entity.PascalName}}.from_dict(d['{{.Name}}']) if '{{.Name}}' in d and d['{{.Name}}'] is not None else None
{{- else if .Entity.Enum }}{{.Entity.PascalName}}.__members__.get(d['{{.Name}}'], None) if '{{.Name}}' in d else None
{{- else}}d.get('{{.Name}}', None){{- end -}}
{{- end -}}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
python-version: ${{ matrix.pyVersion }}

- name: Run tests
run: make dev-init test
run: make dev test

- name: Publish test coverage
uses: codecov/codecov-action@v1
Expand All @@ -38,7 +38,7 @@ jobs:
uses: actions/checkout@v2

- name: Format all files
run: make dev-init fmt
run: make dev fmt

- name: Fail on differences
run: git diff --exit-code
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
steps:
- uses: actions/checkout@v3

- run: pip install -e '.[dev]'
- run: make dev

- name: Build wheel
run: python3 setup.py bdist_wheel
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ __pycache__
.idea
databricks-sdk-py.iml
.databricks
.coverage
.coverage
htmlcov
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dev-init:
dev:
python3 -m venv .venv
. .venv/bin/activate
pip install .
Expand All @@ -16,5 +16,8 @@ lint:
test:
pytest -m 'not integration' --cov=databricks --cov-report html tests

integration:
pytest -n auto -m 'integration' --cov=databricks --cov-report html tests

coverage: test
open htmlcov/index.html
4 changes: 4 additions & 0 deletions databricks/sdk/runtime/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,9 @@ def _get_global_dbutils():
from ._impl import _RemoteDbUtils
if not dbutils:
dbutils = _RemoteDbUtils()
except NameError:
from ._impl import _RemoteDbUtils
if not dbutils:
dbutils = _RemoteDbUtils()

__all__ = ['dbutils']
18 changes: 11 additions & 7 deletions databricks/sdk/service/billing.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit abab568

Please sign in to comment.