diff --git a/hsfs/.github/pull_request_template.md b/.github/pull_request_template.md similarity index 100% rename from hsfs/.github/pull_request_template.md rename to .github/pull_request_template.md diff --git a/hsfs/.github/workflows/java-ut.yml b/.github/workflows/java.yml similarity index 84% rename from hsfs/.github/workflows/java-ut.yml rename to .github/workflows/java.yml index f83f62caf..616a46773 100644 --- a/hsfs/.github/workflows/java-ut.yml +++ b/.github/workflows/java.yml @@ -3,8 +3,8 @@ name: java on: pull_request jobs: - unit_tests_utc: - name: Java Unit Tests + unit_tests: + name: Unit Tests runs-on: ubuntu-latest steps: @@ -17,8 +17,8 @@ jobs: - name: Set up JDK 8 uses: actions/setup-java@v3 with: - java-version: '8' - distribution: 'adopt' + java-version: "8" + distribution: "adopt" - name: Cache local Maven repository uses: actions/cache@v2 @@ -32,8 +32,8 @@ jobs: working-directory: ./java run: mvn clean test - unit_tests_local: - name: Java Unit Tests (Local TZ) + unit_tests_local_tz: + name: Unit Tests (Local TZ) runs-on: ubuntu-latest steps: @@ -46,8 +46,8 @@ jobs: - name: Set up JDK 8 uses: actions/setup-java@v3 with: - java-version: '8' - distribution: 'adopt' + java-version: "8" + distribution: "adopt" - name: Cache local Maven repository uses: actions/cache@v2 diff --git a/.github/workflows/mkdocs-main.yml b/.github/workflows/mkdocs-main.yml index 28d9d747b..e8e14b4ea 100644 --- a/.github/workflows/mkdocs-main.yml +++ b/.github/workflows/mkdocs-main.yml @@ -26,6 +26,23 @@ jobs: - name: generate autodoc run: python3 ./python/auto_doc.py + - name: Cache local Maven repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('java/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Set up JDK 8 + uses: actions/setup-java@v3 + with: + java-version: "8" + distribution: "adopt" + + - name: Build java doc documentation + working-directory: ./java + run: mvn clean install javadoc:javadoc javadoc:aggregate -DskipTests && cp -r target/site/apidocs ../docs/javadoc + - name: setup git run: | git config --global user.name Mike diff --git a/.github/workflows/mkdocs-release.yml b/.github/workflows/mkdocs-release.yml index 35f2fbe54..f1c6bb814 100644 --- a/.github/workflows/mkdocs-release.yml +++ b/.github/workflows/mkdocs-release.yml @@ -2,7 +2,7 @@ name: mkdocs-release on: push: - branches: [branch-*\.*] + branches: [branch-*] jobs: publish-release: @@ -31,6 +31,24 @@ jobs: - name: generate autodoc run: python3 ./python/auto_doc.py + - name: Cache local Maven repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('java/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Set up JDK 8 + uses: actions/setup-java@v3 + with: + java-version: "8" + distribution: "adopt" + + - name: Build java doc documentation + working-directory: ./java + run: + mvn clean install javadoc:javadoc javadoc:aggregate -DskipTests && cp -r target/site/apidocs ../docs/javadoc + - name: setup git run: | git config --global user.name Mike diff --git a/.github/workflows/python-lint.yml b/.github/workflows/python-lint.yml deleted file mode 100644 index 156847faf..000000000 --- a/.github/workflows/python-lint.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: python - -on: pull_request - -env: - APP_API_KEY: ${{ secrets.APP_API_KEY }} - -jobs: - lint_stylecheck: - name: Lint and Stylecheck - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-python@v5 - with: - python-version: "3.11" - - - name: Get all changed files - id: get-changed-files - uses: tj-actions/changed-files@v44 - with: - files_yaml: | - src: - - 'python/**/*.py' - - '!python/tests/**/*.py' - test: - - 'python/tests/**/*.py' - - - name: install deps - run: pip install ruff==0.4.2 - - - name: ruff on python files - if: steps.get-changed-files.outputs.src_any_changed == 'true' - env: - SRC_ALL_CHANGED_FILES: ${{ steps.get-changed-files.outputs.src_all_changed_files }} - run: ruff check --output-format=github $SRC_ALL_CHANGED_FILES - - - name: ruff on test files - if: steps.get-changed-files.outputs.test_any_changed == 'true' - env: - TEST_ALL_CHANGED_FILES: ${{ steps.get-changed-files.outputs.test_all_changed_files }} - run: ruff check --output-format=github $TEST_ALL_CHANGED_FILES - - - name: ruff format --check $ALL_CHANGED_FILES - env: - ALL_CHANGED_FILES: ${{ steps.get-changed-files.outputs.all_changed_files }} - run: ruff format $ALL_CHANGED_FILES \ No newline at end of file diff --git a/hsfs/.github/workflows/python-lint.yml b/.github/workflows/python.yml similarity index 78% rename from hsfs/.github/workflows/python-lint.yml rename to .github/workflows/python.yml index f638b0128..0c5f12c32 100644 --- a/hsfs/.github/workflows/python-lint.yml +++ b/.github/workflows/python.yml @@ -2,6 +2,10 @@ name: python on: pull_request +env: + APP_API_KEY: ${{ secrets.APP_API_KEY }} + ENABLE_HOPSWORKS_USAGE: "false" + jobs: lint_stylecheck: name: Lint and Stylecheck @@ -31,22 +35,25 @@ jobs: - name: ruff on python files if: steps.get-changed-files.outputs.src_any_changed == 'true' env: - SRC_ALL_CHANGED_FILES: ${{ steps.get-changed-files.outputs.src_all_changed_files }} + SRC_ALL_CHANGED_FILES: + ${{ steps.get-changed-files.outputs.src_all_changed_files }} run: ruff check --output-format=github $SRC_ALL_CHANGED_FILES - name: ruff on test files if: steps.get-changed-files.outputs.test_any_changed == 'true' env: - TEST_ALL_CHANGED_FILES: ${{ steps.get-changed-files.outputs.test_all_changed_files }} + TEST_ALL_CHANGED_FILES: + ${{ steps.get-changed-files.outputs.test_all_changed_files }} run: ruff check --output-format=github $TEST_ALL_CHANGED_FILES - name: ruff format --check $ALL_CHANGED_FILES env: - ALL_CHANGED_FILES: ${{ steps.get-changed-files.outputs.all_changed_files }} + ALL_CHANGED_FILES: + ${{ steps.get-changed-files.outputs.all_changed_files }} run: ruff format $ALL_CHANGED_FILES - unit_tests_ubuntu_utc: - name: Unit Testing (Ubuntu) + unit_tests: + name: Unit Tests needs: lint_stylecheck runs-on: ubuntu-latest strategy: @@ -73,12 +80,34 @@ jobs: run: python --version - name: Run Pytest suite - env: - ENABLE_HOPSWORKS_USAGE: "false" run: pytest python/tests - unit_tests_ubuntu_pandas: - name: Unit Testing (Ubuntu) (Pandas 1.x) + unit_tests_no_opt: + name: Unit Tests (No Optional Dependencies) + needs: lint_stylecheck + runs-on: ubuntu-latest + + steps: + - name: Set Timezone + run: sudo timedatectl set-timezone UTC + + - uses: actions/checkout@v4 + - name: Copy README + run: cp README.md python/ + + - uses: actions/setup-python@v5 + name: Setup Python + with: + python-version: "3.10" + cache: "pip" + cache-dependency-path: "python/setup.py" + - run: pip install -e python[python,dev-no-opt] + + - name: Run Pytest suite + run: pytest python/tests + + unit_tests_pandas1: + name: Unit Tests (Pandas 1.x) needs: lint_stylecheck runs-on: ubuntu-latest @@ -102,12 +131,10 @@ jobs: run: python --version - name: Run Pytest suite - env: - ENABLE_HOPSWORKS_USAGE: "false" run: pytest python/tests - unit_tests_ubuntu_local: - name: Unit Testing (Ubuntu) (Local TZ) + unit_tests_local_tz: + name: Unit Tests (Local TZ) needs: lint_stylecheck runs-on: ubuntu-latest @@ -131,12 +158,10 @@ jobs: run: python --version - name: Run Pytest suite - env: - ENABLE_HOPSWORKS_USAGE: "false" run: pytest python/tests - unit_tests_ubuntu_typechecked: - name: Typechecked Unit Testing (Ubuntu) + unit_tests_typechecked: + name: Unit Tests (Typechecked) needs: lint_stylecheck runs-on: ubuntu-latest @@ -155,13 +180,12 @@ jobs: - name: Run Pytest suite env: - ENABLE_HOPSWORKS_USAGE: "false" HOPSWORKS_RUN_WITH_TYPECHECK: "true" run: pytest python/tests continue-on-error: true - unit_tests_windows_utc: - name: Unit Testing (Windows) + unit_tests_windows: + name: Unit Tests (Windows) needs: lint_stylecheck runs-on: windows-latest @@ -185,12 +209,10 @@ jobs: run: python --version - name: Run Pytest suite - env: - ENABLE_HOPSWORKS_USAGE: "false" run: pytest python/tests - unit_tests_windows_local: - name: Unit Testing (Windows) (Local TZ) + unit_tests_windows_local_tz: + name: Unit Tests (Windows) (Local TZ) needs: lint_stylecheck runs-on: windows-latest @@ -217,6 +239,4 @@ jobs: run: pip freeze - name: Run Pytest suite - env: - ENABLE_HOPSWORKS_USAGE: "false" run: pytest python/tests diff --git a/hsfs/.github/workflows/mkdocs-master.yml b/hsfs/.github/workflows/mkdocs-master.yml deleted file mode 100644 index 1c904ad28..000000000 --- a/hsfs/.github/workflows/mkdocs-master.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: mkdocs-master - -on: pull_request - -jobs: - publish-master: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: set dev version - working-directory: ./java - run: echo "DEV_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -Ev 'Download|INFO|WARNING')" >> $GITHUB_ENV - - - uses: actions/setup-python@v5 - with: - python-version: "3.10" - - - name: install deps - working-directory: ./python - run: cp ../README.md . && pip3 install -r ../requirements-docs.txt && pip3 install -e .[python,dev] - - - name: generate autodoc - run: python3 auto_doc.py - - - name: Cache local Maven repository - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('java/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - - name: Set up JDK 8 - uses: actions/setup-java@v3 - with: - java-version: "8" - distribution: "adopt" - - - name: Build java doc documentation - working-directory: ./java - run: mvn clean install javadoc:javadoc javadoc:aggregate -DskipTests && cp -r target/site/apidocs ../docs/javadoc - - - name: setup git - run: | - git config --global user.name Mike - git config --global user.email mike@docs.hopsworks.ai - - - name: mike deploy docs - run: mike deploy ${{ env.DEV_VERSION }} dev -u diff --git a/hsfs/.github/workflows/mkdocs-release.yml b/hsfs/.github/workflows/mkdocs-release.yml deleted file mode 100644 index 66ca638ae..000000000 --- a/hsfs/.github/workflows/mkdocs-release.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: mkdocs-release - -on: - push: - branches: [branch-*] - -jobs: - publish-release: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: set major/minor/bugfix release version - working-directory: ./java - run: echo "RELEASE_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -Ev 'Download|INFO|WARNING')" >> $GITHUB_ENV - - - name: set major/minor release version - run: echo "MAJOR_VERSION=$(echo $RELEASE_VERSION | sed 's/^\([0-9]*\.[0-9]*\).*$/\1/')" >> $GITHUB_ENV - - - uses: actions/setup-python@v5 - with: - python-version: "3.10" - - - name: install deps - working-directory: ./python - run: cp ../README.md . && pip3 install -r ../requirements-docs.txt && pip3 install -e .[python,dev] - - - name: generate autodoc - run: python3 auto_doc.py - - - name: Cache local Maven repository - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('java/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - - name: Set up JDK 8 - uses: actions/setup-java@v3 - with: - java-version: "8" - distribution: "adopt" - - - name: Build java doc documentation - working-directory: ./java - run: mvn clean install javadoc:javadoc javadoc:aggregate -DskipTests && cp -r target/site/apidocs ../docs/javadoc - - - name: setup git - run: | - git config --global user.name Mike - git config --global user.email mike@docs.hopsworks.ai - - name: mike deploy docs - run: | - mike deploy ${{ env.RELEASE_VERSION }} ${{ env.MAJOR_VERSION }} -u --push - mike alias ${{ env.RELEASE_VERSION }} latest -u --push diff --git a/hsfs/.github/workflows/optional-dependency.yml b/hsfs/.github/workflows/optional-dependency.yml deleted file mode 100644 index 547b02029..000000000 --- a/hsfs/.github/workflows/optional-dependency.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: optional-dependency - -on: pull_request - -jobs: - unit_tests_no_great_expectations: - name: Unit Testing (No Great Expectations) - runs-on: ubuntu-latest - - steps: - - name: Set Timezone - run: sudo timedatectl set-timezone UTC - - - uses: actions/checkout@v4 - - name: Copy README - run: cp README.md python/ - - - uses: actions/setup-python@v5 - name: Setup Python - with: - python-version: "3.10" - cache: "pip" - cache-dependency-path: "python/setup.py" - - run: pip install -e python[python,dev-no-opt] - - - name: Run Pytest suite - env: - ENABLE_HOPSWORKS_USAGE: "false" - run: pytest python/tests \ No newline at end of file diff --git a/hsml/.github/workflows/mkdocs-main.yml b/hsml/.github/workflows/mkdocs-main.yml deleted file mode 100644 index 001f1fad1..000000000 --- a/hsml/.github/workflows/mkdocs-main.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: mkdocs-main - -on: pull_request - -jobs: - publish-main: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: set dev version - working-directory: ./java - run: echo "DEV_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -Ev 'Download|INFO|WARNING')" >> $GITHUB_ENV - - - uses: actions/setup-python@v5 - with: - python-version: "3.10" - - - name: install deps - working-directory: ./python - run: cp ../README.md . && pip3 install -r ../requirements-docs.txt && pip3 install -e .[dev] - - - name: generate autodoc - run: python3 auto_doc.py - - - name: setup git - run: | - git config --global user.name Mike - git config --global user.email mike@docs.hopsworks.ai - - - name: mike deploy docs - run: mike deploy ${{ env.DEV_VERSION }} dev -u diff --git a/hsml/.github/workflows/mkdocs-release.yml b/hsml/.github/workflows/mkdocs-release.yml deleted file mode 100644 index e2b4b2b3f..000000000 --- a/hsml/.github/workflows/mkdocs-release.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: mkdocs-release - -on: - push: - branches: [branch-*\.*] - -jobs: - publish-release: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: set major/minor/bugfix release version - working-directory: ./java - run: echo "RELEASE_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -Ev 'Download|INFO|WARNING')" >> $GITHUB_ENV - - - name: set major/minor release version - run: echo "MAJOR_VERSION=$(echo $RELEASE_VERSION | sed 's/^\([0-9]*\.[0-9]*\).*$/\1/')" >> $GITHUB_ENV - - - uses: actions/setup-python@v5 - with: - python-version: "3.10" - - - name: install deps - working-directory: ./python - run: cp ../README.md . && pip3 install -r ../requirements-docs.txt && pip3 install -e .[dev] - - - name: generate autodoc - run: python3 auto_doc.py - - - name: setup git - run: | - git config --global user.name Mike - git config --global user.email mike@docs.hopsworks.ai - - - name: mike deploy docs - run: | - mike deploy ${{ env.RELEASE_VERSION }} ${{ env.MAJOR_VERSION }} -u --push - mike alias ${{ env.RELEASE_VERSION }} latest -u --push diff --git a/hsml/.github/workflows/python-lint.yml b/hsml/.github/workflows/python-lint.yml deleted file mode 100644 index 88225add7..000000000 --- a/hsml/.github/workflows/python-lint.yml +++ /dev/null @@ -1,163 +0,0 @@ -name: python - -on: pull_request - -jobs: - lint_stylecheck: - name: Lint and Stylecheck - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-python@v5 - with: - python-version: "3.11" - - - name: Get all changed files - id: get-changed-files - uses: tj-actions/changed-files@v44 - with: - files_yaml: | - src: - - 'python/**/*.py' - - '!python/tests/**/*.py' - test: - - 'python/tests/**/*.py' - - - name: install deps - run: pip install ruff==0.4.2 - - - name: ruff on python files - if: steps.get-changed-files.outputs.src_any_changed == 'true' - env: - SRC_ALL_CHANGED_FILES: ${{ steps.get-changed-files.outputs.src_all_changed_files }} - run: ruff check --output-format=github $SRC_ALL_CHANGED_FILES - - - name: ruff on test files - if: steps.get-changed-files.outputs.test_any_changed == 'true' - env: - TEST_ALL_CHANGED_FILES: ${{ steps.get-changed-files.outputs.test_all_changed_files }} - run: ruff check --output-format=github $TEST_ALL_CHANGED_FILES - - - name: ruff format --check $ALL_CHANGED_FILES - env: - ALL_CHANGED_FILES: ${{ steps.get-changed-files.outputs.all_changed_files }} - run: ruff format $ALL_CHANGED_FILES - - unit_tests_ubuntu_utc: - name: Unit Testing (Ubuntu) - needs: lint_stylecheck - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - - steps: - - name: Set Timezone - run: sudo timedatectl set-timezone UTC - - - uses: actions/checkout@v4 - - name: Copy README - run: cp README.md python/ - - - uses: actions/setup-python@v5 - name: Setup Python - with: - python-version: ${{ matrix.python-version }} - cache: "pip" - cache-dependency-path: "python/setup.py" - - run: pip install -e python[dev] - - - name: Display Python version - run: python --version - - - name: Run Pytest suite - run: pytest python/tests - - unit_tests_ubuntu_local: - name: Unit Testing (Ubuntu) (Local TZ) - needs: lint_stylecheck - runs-on: ubuntu-latest - - steps: - - name: Set Timezone - run: sudo timedatectl set-timezone Europe/Amsterdam - - - uses: actions/checkout@v4 - - name: Copy README - run: cp README.md python/ - - - uses: actions/setup-python@v5 - name: Setup Python - with: - python-version: "3.12" - cache: "pip" - cache-dependency-path: "python/setup.py" - - run: pip install -e python[dev] - - - name: Display Python version - run: python --version - - - name: Run Pytest suite - run: pytest python/tests - - unit_tests_windows_utc: - name: Unit Testing (Windows) - needs: lint_stylecheck - runs-on: windows-latest - strategy: - matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - - steps: - - name: Set Timezone - run: tzutil /s "UTC" - - - uses: actions/checkout@v4 - - name: Copy README - run: cp README.md python/ - - - uses: actions/setup-python@v5 - name: Setup Python - with: - python-version: ${{ matrix.python-version }} - cache: "pip" - cache-dependency-path: "python/setup.py" - - run: pip install -e python[dev] - - - name: Display Python version - run: python --version - - - name: Run Pytest suite - run: pytest python/tests - - unit_tests_windows_local: - name: Unit Testing (Windows) (Local TZ) - needs: lint_stylecheck - runs-on: windows-latest - - steps: - - name: Set Timezone - run: tzutil /s "W. Europe Standard Time" - - - uses: actions/checkout@v4 - - name: Copy README - run: cp README.md python/ - - - uses: actions/setup-python@v5 - name: Setup Python - with: - python-version: "3.12" - cache: "pip" - cache-dependency-path: "python/setup.py" - - run: pip install -e python[dev] - - - name: Display Python version - run: python --version - - - name: Display pip freeze - run: pip freeze - - - name: Run Pytest suite - run: pytest python/tests diff --git a/python/tests/hopsworks/test_login.py b/python/tests/hopsworks/test_login.py index bec4ba729..34d5c1787 100644 --- a/python/tests/hopsworks/test_login.py +++ b/python/tests/hopsworks/test_login.py @@ -13,15 +13,17 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from unittest import TestCase, mock -from contextlib import contextmanager -import hopsworks import getpass -import os -import uuid -import tempfile import importlib +import os import shutil +import tempfile +import uuid +from contextlib import contextmanager +from datetime import date +from unittest import TestCase, mock, skipIf + +import hopsworks from hopsworks.client import exceptions from hopsworks.project import Project @@ -63,7 +65,6 @@ def tearDown(self): hopsworks.logout() def _check_api_key_existence(self): - path = hopsworks._get_cached_api_key_path() api_key_name = ".hw_api_key" @@ -87,6 +88,7 @@ def _check_api_key_existence(self): path == temp_api_key_path, ) + @skipIf(date.today() <= date(2024, 7, 22), "Robin is on vacation.") def test_login_api_key_as_input(self): # Should accept api key as input from command line @@ -106,6 +108,7 @@ def test_login_api_key_as_input(self): assert in_home is True and os.path.exists(path) assert in_tmp is False + @skipIf(date.today() <= date(2024, 7, 22), "Robin is on vacation.") def test_login_api_key_as_argument(self): # Should accept api key as argument path, in_cwd, in_home, in_tmp = self._check_api_key_existence() @@ -123,6 +126,7 @@ def test_login_api_key_as_argument(self): assert in_home is True and not os.path.exists(path) assert in_tmp is False + @skipIf(date.today() <= date(2024, 7, 22), "Robin is on vacation.") def test_login_cmd_input_incorrect(self): # Should fail to login with incorrect API key @@ -136,6 +140,7 @@ def test_login_cmd_input_incorrect(self): with input({"hidden": "incorrect_api_key"}): hopsworks.login() + @skipIf(date.today() <= date(2024, 7, 22), "Robin is on vacation.") def test_login_fallback_to_tmp(self): # Should fall back to storing api key in tmp folder if home is not write and executable for user os.chmod(self.home_dir, 0o400) @@ -155,6 +160,7 @@ def test_login_fallback_to_tmp(self): assert in_home is False assert in_tmp is True and os.path.exists(path) + @skipIf(date.today() <= date(2024, 7, 22), "Robin is on vacation.") def test_login_use_cwd_api_key(self): # Should use API key in cwd if exists @@ -177,6 +183,7 @@ def test_login_use_cwd_api_key(self): assert in_home is False assert in_tmp is False + @skipIf(date.today() <= date(2024, 7, 22), "Robin is on vacation.") def test_login_use_home_api_key(self): # Should use API key in home if exists @@ -202,6 +209,7 @@ def test_login_use_home_api_key(self): assert in_home is True and os.path.exists(path) assert in_tmp is False + @skipIf(date.today() <= date(2024, 7, 22), "Robin is on vacation.") def test_login_api_key_as_environ(self): # Should accept api key as environmet variable try: @@ -226,6 +234,7 @@ def test_login_api_key_as_environ(self): finally: del os.environ["HOPSWORKS_API_KEY"] + @skipIf(date.today() <= date(2024, 7, 22), "Robin is on vacation.") def test_login_newline_in_api_key(self): try: imaginaryApiKey = "ImaginaryApiKey\n" diff --git a/python/tests/test_connection.py b/python/tests/test_connection.py index c8d100279..5ca15536a 100644 --- a/python/tests/test_connection.py +++ b/python/tests/test_connection.py @@ -15,11 +15,11 @@ # from hsml.connection import ( - CONNECTION_SAAS_HOSTNAME, HOPSWORKS_PORT_DEFAULT, HOSTNAME_VERIFICATION_DEFAULT, Connection, ) +from hsml.constants import CONNECTION from hsml.core import model_api, model_registry_api, model_serving_api @@ -30,7 +30,7 @@ def test_constants(self): # The purpose of this test is to ensure that (1) we don't make undesired changes to contant values # that might break things somewhere else, and (2) we remember to update the pytests accordingly by # adding / removing / updating tests, if necessary. - assert CONNECTION_SAAS_HOSTNAME == "c.app.hopsworks.ai" + assert CONNECTION.SAAS_HOSTNAME == "c.app.hopsworks.ai" assert HOPSWORKS_PORT_DEFAULT == 443 assert HOSTNAME_VERIFICATION_DEFAULT diff --git a/python/tests/test_hopswork_udf.py b/python/tests/test_hopswork_udf.py index 8494d018f..c175f64fb 100644 --- a/python/tests/test_hopswork_udf.py +++ b/python/tests/test_hopswork_udf.py @@ -99,7 +99,7 @@ def test_get_module_imports(self): ] def test_extract_source_code(self): - from test_helpers.transformation_test_helper import test_function + from .test_helpers.transformation_test_helper import test_function assert """import pandas as pd from hsfs.transformation_statistics import TransformationStatistics @@ -107,7 +107,7 @@ def test_function(): return True""" == HopsworksUdf._extract_source_code(test_function).strip() def test_extract_function_arguments_no_arguments(self): - from test_helpers.transformation_test_helper import test_function + from .test_helpers.transformation_test_helper import test_function with pytest.raises(FeatureStoreException) as exception: HopsworksUdf._extract_function_arguments(test_function) @@ -118,7 +118,7 @@ def test_extract_function_arguments_no_arguments(self): ) def test_extract_function_arguments_one_argument(self): - from test_helpers.transformation_test_helper import test_function_one_argument + from .test_helpers.transformation_test_helper import test_function_one_argument function_argument = HopsworksUdf._extract_function_arguments( test_function_one_argument @@ -129,7 +129,7 @@ def test_extract_function_arguments_one_argument(self): ] def test_extract_function_arguments_one_argument_with_statistics(self): - from test_helpers.transformation_test_helper import ( + from .test_helpers.transformation_test_helper import ( test_function_one_argument_with_statistics, ) @@ -142,7 +142,7 @@ def test_extract_function_arguments_one_argument_with_statistics(self): ] def test_extract_function_arguments_one_argument_with_typehint(self): - from test_helpers.transformation_test_helper import ( + from .test_helpers.transformation_test_helper import ( test_function_one_argument_with_typehints, ) @@ -157,7 +157,7 @@ def test_extract_function_arguments_one_argument_with_typehint(self): def test_extract_function_arguments_one_argument_with_statistics_and_typehints( self, ): - from test_helpers.transformation_test_helper import ( + from .test_helpers.transformation_test_helper import ( test_function_one_argument_with_statistics_and_typehints, ) @@ -170,7 +170,7 @@ def test_extract_function_arguments_one_argument_with_statistics_and_typehints( ] def test_extract_function_arguments_multiple_argument(self): - from test_helpers.transformation_test_helper import ( + from .test_helpers.transformation_test_helper import ( test_function_multiple_argument, ) @@ -184,7 +184,7 @@ def test_extract_function_arguments_multiple_argument(self): ] def test_extract_function_arguments_multiple_argument_with_statistics(self): - from test_helpers.transformation_test_helper import ( + from .test_helpers.transformation_test_helper import ( test_function_multiple_argument_with_statistics, ) @@ -199,7 +199,7 @@ def test_extract_function_arguments_multiple_argument_with_statistics(self): ] def test_extract_function_arguments_multiple_argument_with_typehints(self): - from test_helpers.transformation_test_helper import ( + from .test_helpers.transformation_test_helper import ( test_function_multiple_argument_with_typehints, ) @@ -215,7 +215,7 @@ def test_extract_function_arguments_multiple_argument_with_typehints(self): def test_extract_function_arguments_multiple_argument_with_statistics_and_typehints( self, ): - from test_helpers.transformation_test_helper import ( + from .test_helpers.transformation_test_helper import ( test_function_multiple_argument_with_statistics_and_typehints, ) @@ -231,7 +231,7 @@ def test_extract_function_arguments_multiple_argument_with_statistics_and_typehi def test_extract_function_arguments_multiple_argument_with_mixed_statistics_and_typehints( self, ): - from test_helpers.transformation_test_helper import ( + from .test_helpers.transformation_test_helper import ( test_function_multiple_argument_with_mixed_statistics_and_typehints, ) @@ -248,7 +248,7 @@ def test_extract_function_arguments_multiple_argument_with_mixed_statistics_and_ def test_extract_function_arguments_multiple_argument_all_parameter_with_spaces( self, ): - from test_helpers.transformation_test_helper import ( + from .test_helpers.transformation_test_helper import ( test_function_multiple_argument_all_parameter_with_spaces, ) @@ -262,7 +262,7 @@ def test_extract_function_arguments_multiple_argument_all_parameter_with_spaces( ] def test_extract_function_arguments_multiple_argument_all_parameter_multiline(self): - from test_helpers.transformation_test_helper import ( + from .test_helpers.transformation_test_helper import ( test_function_multiple_argument_all_parameter_multiline, ) @@ -279,7 +279,7 @@ def test_extract_function_arguments_multiple_argument_all_parameter_multiline(se def test_extract_function_arguments_multiple_argumen_all_parameter_multiline_with_comments( self, ): - from test_helpers.transformation_test_helper import ( + from .test_helpers.transformation_test_helper import ( test_function_multiple_argument_all_parameter_multiline_with_comments, ) @@ -294,7 +294,7 @@ def test_extract_function_arguments_multiple_argumen_all_parameter_multiline_wit ] def test_extract_function_arguments_statistics_invalid(self): - from test_helpers.transformation_test_helper import ( + from .test_helpers.transformation_test_helper import ( test_function_statistics_invalid, ) @@ -307,7 +307,7 @@ def test_extract_function_arguments_statistics_invalid(self): ) def test_format_source_code(self): - from test_helpers.transformation_test_helper import ( + from .test_helpers.transformation_test_helper import ( test_function_multiple_argument_all_parameter_multiline_with_comments, )