diff --git a/.github/workflows/build-linux.yaml b/.github/workflows/build-linux.yaml index cc722ef9e..7c0f1e120 100644 --- a/.github/workflows/build-linux.yaml +++ b/.github/workflows/build-linux.yaml @@ -41,37 +41,47 @@ jobs: run: pip list | grep kiara - name: test with pytest run: make test + - name: Coveralls + nuses: coverallsapp/github-action@v2 + with: + parallel: true + flag-name: run ${{ join(matrix.*, ' - ') }} coverage: name: test coverage runs-on: ubuntu-latest steps: - - name: "Set up Python 3.10" - uses: actions/setup-python@v4 - with: - python-version: "3.10" - - name: pip cache - id: pip-cache - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.*') }} - - uses: actions/checkout@v2 - - name: install core_types plugin - run: pip install -U git+https://github.com/DHARPA-project/kiara_plugin.core_types@develop - - name: install tabular types plugin - run: pip install -U git+https://github.com/DHARPA-project/kiara_plugin.tabular@develop - - name: install kiara - run: pip install -U .[dev_testing] - - name: display installed kiara and module package versions - run: pip list | grep kiara - - name: Run coverage - run: coverage run -m pytest tests - - name: coveralls + - name: Coveralls Finished uses: coverallsapp/github-action@v2 with: - format: python - allow-empty: true + parallel-finished: true +# carryforward: "run-1,run-2" +# - name: "Set up Python 3.10" +# uses: actions/setup-python@v4 +# with: +# python-version: "3.10" +# - name: pip cache +# id: pip-cache +# uses: actions/cache@v3 +# with: +# path: ~/.cache/pip +# key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.*') }} +# - uses: actions/checkout@v2 +# - name: install core_types plugin +# run: pip install -U git+https://github.com/DHARPA-project/kiara_plugin.core_types@develop +# - name: install tabular types plugin +# run: pip install -U git+https://github.com/DHARPA-project/kiara_plugin.tabular@develop +# - name: install kiara +# run: pip install -U .[dev_testing] +# - name: display installed kiara and module package versions +# run: pip list | grep kiara +# - name: Run coverage +# run: coverage run -m pytest tests +# - name: coveralls +# uses: coverallsapp/github-action@v2 +# with: +# format: python +# allow-empty: true # - name: Upload coverage data to coveralls.io # run: coveralls --service=github # env: diff --git a/src/kiara/interfaces/python_api/models/job.py b/src/kiara/interfaces/python_api/models/job.py index 9dbe6efce..d6be61f60 100644 --- a/src/kiara/interfaces/python_api/models/job.py +++ b/src/kiara/interfaces/python_api/models/job.py @@ -276,6 +276,7 @@ def run_tests(self): def run_job(self) -> "ValueMap": print(f"Running checks for job '{self._job_desc.job_alias}'...") # noqa + try: result = self._kiara_api.run_job(operation=self._job_desc) except Exception as e: diff --git a/src/kiara/registries/data/__init__.py b/src/kiara/registries/data/__init__.py index a03a0103f..4e4f7202b 100644 --- a/src/kiara/registries/data/__init__.py +++ b/src/kiara/registries/data/__init__.py @@ -368,7 +368,6 @@ def get_value(self, value: Union[uuid.UUID, ValueLink, str]) -> Value: raise Exception( f"Can't retrieve value for '{value}': invalid type '{type(value)}'." ) - _value_id = self._alias_resolver.resolve_alias(value) else: _value_id = value @@ -1018,6 +1017,7 @@ def create_valuemap( ) -> ValueMap: """Extract a set of [Value][kiara.data.values.Value] from Python data and ValueSchemas.""" input_details = {} + for input_name, value_schema in schema.items(): input_details[input_name] = {"schema": value_schema} @@ -1042,7 +1042,15 @@ def create_valuemap( try: _d = uuid.UUID(_d) except Exception: - pass + if schema[input_name].type == "string" and not ( + _d.startswith("alias:") or _d.startswith("value:") + ): + pass + else: + try: + _d = self._alias_resolver.resolve_alias(_d) + except Exception: + pass if isinstance(_d, Value): _resolved[input_name] = _d diff --git a/src/kiara/utils/testing/__init__.py b/src/kiara/utils/testing/__init__.py index d7d58540b..0d8561f7c 100644 --- a/src/kiara/utils/testing/__init__.py +++ b/src/kiara/utils/testing/__init__.py @@ -16,6 +16,10 @@ def get_init_job(jobs_folder: Path) -> Union[None, JobDesc]: if init_test_yaml.is_file(): return JobDesc.create_from_file(init_test_yaml) + init_test_yaml = jobs_folder / f"{INIT_EXAMPLE_NAME}.yml" + if init_test_yaml.is_file(): + return JobDesc.create_from_file(init_test_yaml) + init_test_json = jobs_folder / f"{INIT_EXAMPLE_NAME}.json" if init_test_json.is_file(): return JobDesc.create_from_file(init_test_json) @@ -29,8 +33,17 @@ def list_job_descs(jobs_folder: Path): if init_job is not None: yield init_job - for f in sorted(jobs_folder.glob("*")): - if f.name in [f"{INIT_EXAMPLE_NAME}.yaml", f"{INIT_EXAMPLE_NAME}.json"]: + files = ( + list(jobs_folder.glob("*.yaml")) + + list(jobs_folder.glob("*.yml")) + + list(jobs_folder.glob("*.json")) + ) + for f in sorted(files): + if f.name in [ + f"{INIT_EXAMPLE_NAME}.yaml", + f"{INIT_EXAMPLE_NAME}.yml", + "{INIT_EXAMPLE_NAME}.json", + ]: continue try: job_desc = JobDesc.create_from_file(f) @@ -70,6 +83,8 @@ def get_tests_for_job( if test_checks.is_file(): test_data: Dict[str, Any] = get_data_from_file(test_checks) + if test_data is None: + test_data = {} else: test_data = {}