From 61d878ce507b42ed4c6adaf2284e45834b0b36a0 Mon Sep 17 00:00:00 2001 From: Markus Petke Date: Thu, 7 Sep 2023 11:59:03 +0200 Subject: [PATCH] rename package --- .devcontainer/devcontainer.json | 2 +- .github/workflows/ci.yml | 16 ++++++++-------- .../__init__.py | 0 .../src/__init__.py | 0 .../src/gen_desired_state.py | 11 +++++++---- .../src/install_deps.py | 0 .../src/requirements.txt | 0 .../test/.velocitas.json | 0 .../test/app/AppManifest.json | 0 .../test/integration/integration_test.py | 4 ++-- .../test/requirements.txt | 0 .../test/test_gen_desired_state.py | 2 +- manifest.json | 4 ++-- 13 files changed, 21 insertions(+), 18 deletions(-) rename {pantaris_integration => desired_state_generator}/__init__.py (100%) rename {pantaris_integration => desired_state_generator}/src/__init__.py (100%) rename {pantaris_integration => desired_state_generator}/src/gen_desired_state.py (94%) rename {pantaris_integration => desired_state_generator}/src/install_deps.py (100%) rename {pantaris_integration => desired_state_generator}/src/requirements.txt (100%) rename {pantaris_integration => desired_state_generator}/test/.velocitas.json (100%) rename {pantaris_integration => desired_state_generator}/test/app/AppManifest.json (100%) rename {pantaris_integration => desired_state_generator}/test/integration/integration_test.py (93%) rename {pantaris_integration => desired_state_generator}/test/requirements.txt (100%) rename {pantaris_integration => desired_state_generator}/test/test_gen_desired_state.py (94%) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 2156d3fa..115097a0 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -18,7 +18,7 @@ "editor.defaultFormatter": "ms-python.black-formatter" }, "python.testing.pytestArgs": [ - "--ignore=pantaris_integration/test/integration", + "--ignore=desired_state_generator/test/integration", "--ignore=runtime_k3d/test/integration", "--ignore=runtime_kanto/test/integration", "--ignore=runtime_local/test/integration", diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 97eed7fd..bc2dfc3d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,7 +60,7 @@ jobs: pytest --ignore-glob='*integration*' --override-ini junit_family=xunit1 --junit-xml=./results/UnitTest/junit.xml \ --cov . \ --cov-report=xml:results/CodeCoverage/cobertura-coverage.xml \ - --cov-branch ./runtime_k3d/test ./runtime_local/test ./pantaris_integration/test + --cov-branch ./runtime_k3d/test ./runtime_local/test ./desired_state_generator/test - name: Publish Unit Test Results uses: mikepenz/action-junit-report@v3 @@ -224,8 +224,8 @@ jobs: path: | runtime_kanto/test/logs - run-pantaris-integration-tests: - name: Run Integration Tests for pantaris-integration + run-desired-state-generator-tests: + name: Run Integration Tests for desired state generator runs-on: ubuntu-22.04 env: DOCKER_BUILDKIT: 1 @@ -246,22 +246,22 @@ jobs: run: | sudo curl -L https://github.com/eclipse-velocitas/cli/releases/latest/download/velocitas-linux-x64 -o /usr/bin/velocitas sudo chmod +x /usr/bin/velocitas - pip install -r pantaris_integration/test/requirements.txt + pip install -r desired_state_generator/test/requirements.txt - name: Init velocitas project run: | - cd pantaris_integration/test + cd desired_state_generator/test velocitas init -v - name: Run integration tests for kanto run: | - cd pantaris_integration/test + cd desired_state_generator/test pytest -s -x ./integration/integration_test.py - name: Upload log files as artifacts if: always() uses: actions/upload-artifact@v3 with: - name: "Log files Pantaris-Integration" + name: "Log files Desired State Generator" path: | - pantaris_integration/test/test/logs + desired_state_generator/test/test/logs diff --git a/pantaris_integration/__init__.py b/desired_state_generator/__init__.py similarity index 100% rename from pantaris_integration/__init__.py rename to desired_state_generator/__init__.py diff --git a/pantaris_integration/src/__init__.py b/desired_state_generator/src/__init__.py similarity index 100% rename from pantaris_integration/src/__init__.py rename to desired_state_generator/src/__init__.py diff --git a/pantaris_integration/src/gen_desired_state.py b/desired_state_generator/src/gen_desired_state.py similarity index 94% rename from pantaris_integration/src/gen_desired_state.py rename to desired_state_generator/src/gen_desired_state.py index f02b4aa1..82cf4814 100644 --- a/pantaris_integration/src/gen_desired_state.py +++ b/desired_state_generator/src/gen_desired_state.py @@ -49,21 +49,24 @@ def parse_vehicle_signal_interface(config: Dict[str, Any]) -> List[str]: vss_release_prefix = ( "https://github.com/COVESA/vehicle_signal_specification/releases/download/" ) + version = "" if vss_release_prefix in src: version = src.removeprefix(vss_release_prefix).split("/")[0] requirements.append(f"vss-source-default-vss:{version}") # assuming that databroker and vss have same version requirements.append(f"data-broker-grpc:{version}") elif is_uri(src): - requirements.append(f"vss-source-custom-vss:{get_md5_from_uri(src)}") + version = get_md5_from_uri(src) + requirements.append(f"vss-source-custom-vss:{version}") else: - requirements.append(f"vss-source-custom-vss:{get_md5_for_file(src)}") + version = get_md5_for_file(src) + requirements.append(f"vss-source-custom-vss:{version}") datapoints = config["datapoints"]["required"] for datapoint in datapoints: path = str(datapoint["path"]).lower().replace(".", "-") access = datapoint["access"] - requirements.append(f"vss-{access}-{path}") + requirements.append(f"vss-{access}-{path}:{version}") return requirements @@ -186,7 +189,7 @@ def main(): data = { "name": appName, "source": source, - "type": "binary/container", + "type": "container", "requires": requirements, "provides": [f"{imageName}:{version}"], } diff --git a/pantaris_integration/src/install_deps.py b/desired_state_generator/src/install_deps.py similarity index 100% rename from pantaris_integration/src/install_deps.py rename to desired_state_generator/src/install_deps.py diff --git a/pantaris_integration/src/requirements.txt b/desired_state_generator/src/requirements.txt similarity index 100% rename from pantaris_integration/src/requirements.txt rename to desired_state_generator/src/requirements.txt diff --git a/pantaris_integration/test/.velocitas.json b/desired_state_generator/test/.velocitas.json similarity index 100% rename from pantaris_integration/test/.velocitas.json rename to desired_state_generator/test/.velocitas.json diff --git a/pantaris_integration/test/app/AppManifest.json b/desired_state_generator/test/app/AppManifest.json similarity index 100% rename from pantaris_integration/test/app/AppManifest.json rename to desired_state_generator/test/app/AppManifest.json diff --git a/pantaris_integration/test/integration/integration_test.py b/desired_state_generator/test/integration/integration_test.py similarity index 93% rename from pantaris_integration/test/integration/integration_test.py rename to desired_state_generator/test/integration/integration_test.py index 2c178ed7..55528187 100644 --- a/pantaris_integration/test/integration/integration_test.py +++ b/desired_state_generator/test/integration/integration_test.py @@ -19,14 +19,14 @@ def test_output(): - file_path = f"{Path.cwd()}/pantaris_integration/test/integration" + file_path = f"{Path.cwd()}/desired_state_generator/test/integration" file = f"{file_path}/sampleapp_manifest_v1.json" subprocess.run( [ "velocitas", "exec", "pantaris-integration", - "generated-desired-state", + "generate-desired-state", "-s", "ghcr.io/eclipse-velocitas/vehicle-app-python-template/sampleapp:v1", "-o", diff --git a/pantaris_integration/test/requirements.txt b/desired_state_generator/test/requirements.txt similarity index 100% rename from pantaris_integration/test/requirements.txt rename to desired_state_generator/test/requirements.txt diff --git a/pantaris_integration/test/test_gen_desired_state.py b/desired_state_generator/test/test_gen_desired_state.py similarity index 94% rename from pantaris_integration/test/test_gen_desired_state.py rename to desired_state_generator/test/test_gen_desired_state.py index bbb50c6e..6996c841 100644 --- a/pantaris_integration/test/test_gen_desired_state.py +++ b/desired_state_generator/test/test_gen_desired_state.py @@ -40,4 +40,4 @@ def test_is_uri__true(): def test_is_uri__false(): - assert not is_uri(f"{Path.cwd()}/pantaris_integration/test/__init__.py") + assert not is_uri(f"{Path.cwd()}/LICENSE") diff --git a/manifest.json b/manifest.json index 20e4ae3b..a6a84dd2 100644 --- a/manifest.json +++ b/manifest.json @@ -291,14 +291,14 @@ "id": "install-deps", "executable": "python3", "args": [ - "./pantaris_integration/src/install_deps.py" + "./desired_state_generator/src/install_deps.py" ] }, { "id": "generate-desired-state", "executable": "python3", "args": [ - "./pantaris_integration/src/gen_desired_state.py" + "./desired_state_generator/src/gen_desired_state.py" ] } ],