Skip to content

Commit b616c30

Browse files
authored
#265 fix typehints in tests (#266)
* Fixed type hints in tests * Re-enabled SaaS Tests Fixing #251 * Added free disk space to saas integration tests
1 parent 6f22ca9 commit b616c30

File tree

16 files changed

+63
-31
lines changed

16 files changed

+63
-31
lines changed

.github/workflows/merge-gate.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,13 @@ jobs:
3333
permissions:
3434
contents: read
3535

36-
# Deactivated because SaaS Tests are broken because of breaking API changes in SaaS Rest API
37-
# See https://github.com/exasol/notebook-connector/issues/251
38-
# saas-tests:
39-
# name: SaaS
40-
# needs: [ run-slow-tests ]
41-
# uses: ./.github/workflows/tests-saas.yml
42-
# secrets: inherit
43-
# permissions:
44-
# contents: read
36+
saas-tests:
37+
name: SaaS
38+
needs: [ run-slow-tests ]
39+
uses: ./.github/workflows/tests-saas.yml
40+
secrets: inherit
41+
permissions:
42+
contents: read
4543

4644
large-runner-tests:
4745
name: Large Runner

.github/workflows/tests-saas.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,21 @@ jobs:
1717
with:
1818
fetch-depth: 0
1919

20+
- name: Free disk space
21+
uses: jlumbroso/free-disk-space@main
22+
with:
23+
tool-cache: true
24+
large-packages: false
25+
26+
- name: Free disk space by removing large directories
27+
run: |
28+
sudo rm -rf /usr/local/graalvm/
29+
sudo rm -rf /usr/local/.ghcup/
30+
sudo rm -rf /usr/local/share/powershell
31+
sudo rm -rf /usr/local/share/chromium
32+
sudo rm -rf /usr/local/lib/node_modules
33+
sudo rm -rf /opt/ghc
34+
2035
- name: Setup Python & Poetry Environment
2136
uses: exasol/python-toolbox/.github/actions/python-environment@v1
2237

doc/changes/unreleased.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ This release marks most of the NC's dependencies in file `pyproject.toml` as _op
1212

1313
* #253: Made dependencies optional in file `pyproject.toml`
1414
* #260: Added unit tests for CLI param wrappers
15+
* #265: Fixed type hints in tests
16+
* #251: Re-enabled SaaS integration tests

exasol/nb_connector/bfs_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def _file_in_bucket(file_name: str, bucket: bfs.Bucket) -> bool:
2727

2828

2929
def put_file(
30-
bucket: bfs.Bucket, file_path: pathlib.Path, skip_if_exists: bool = True
30+
bucket: bfs.BucketLike, file_path: pathlib.Path, skip_if_exists: bool = True
3131
) -> bfs.path.BucketPath:
3232
"""
3333
Uploads given file into bucketfs

poetry.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ ignore_missing_imports = true
127127
[[tool.mypy.overrides]]
128128
module = [
129129
"exasol/nb_connector/extension_wrapper_common",
130-
"test.*",
131130
# not yet include py.typed
132131
"docker.*",
133132
"ibis.*",

test/integration/ordinary/itde_mgr_in_container/conftest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import logging
33
import subprocess
44
import textwrap
5+
from collections.abc import Iterator
56
from inspect import cleandoc
67
from pathlib import Path
78

@@ -54,7 +55,7 @@ def dockerfile_content() -> str:
5455

5556

5657
@pytest.fixture
57-
def docker_image(dockerfile_content) -> Image:
58+
def docker_image(dockerfile_content) -> Iterator[Image]:
5859
with ContextDockerClient() as client:
5960
image, _ = client.images.build(
6061
fileobj=io.BytesIO(dockerfile_content.encode("UTF-8"))

test/integration/ordinary/test_sagemaker_extension_wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ def test_initialize_sme_extension(secrets: Secrets, setup_itde):
3838
assert script_counts["SCRIPTING"] >= 4
3939
assert script_counts["UDF"] >= 5
4040
assert_connection_exists(
41-
secrets.get(CKey.sme_aws_connection), pyexasol_connection
41+
secrets[CKey.sme_aws_connection], pyexasol_connection
4242
)

test/integration/ordinary/test_transformers_extension_wrapper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ def test_initialize_te_extension(secrets: Secrets, setup_itde):
3232
script_counts = get_script_counts(pyexasol_connection, secrets)
3333
assert script_counts["UDF"] > 5
3434
assert_connection_exists(
35-
secrets.get(CKey.bfs_connection_name), pyexasol_connection
35+
secrets[CKey.bfs_connection_name], pyexasol_connection
3636
)
3737
assert_connection_exists(
38-
secrets.get(CKey.te_hf_connection), pyexasol_connection
38+
secrets[CKey.te_hf_connection], pyexasol_connection
3939
)

test/integration/saas_instance/test_cloud_storage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ def test_saas_bucket_can_be_iterated(backend, secrets: Secrets, setup_itde):
3636
bucket = open_bucketfs_bucket(secrets)
3737
NAME = "temp-file.dat"
3838
bucket.upload(NAME, b"some data")
39-
assert NAME in list(bucket)
39+
assert NAME in bucket.files

0 commit comments

Comments
 (0)