diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 2156d3fa..7501d935 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=desire_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..1c66bfc1 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 ./desire_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 desire_state_generator/test/requirements.txt - name: Init velocitas project run: | - cd pantaris_integration/test + cd desire_state_generator/test velocitas init -v - name: Run integration tests for kanto run: | - cd pantaris_integration/test + cd desire_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 + desire_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..66ff2078 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()}/desire_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..2746bb5a 100644 --- a/manifest.json +++ b/manifest.json @@ -291,14 +291,14 @@ "id": "install-deps", "executable": "python3", "args": [ - "./pantaris_integration/src/install_deps.py" + "./desire_state_generator/src/install_deps.py" ] }, { "id": "generate-desired-state", "executable": "python3", "args": [ - "./pantaris_integration/src/gen_desired_state.py" + "./desire_state_generator/src/gen_desired_state.py" ] } ],