Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
doosuu committed Aug 30, 2023
1 parent 081e701 commit 7eb1b72
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 3 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# devenv-devcontainer-setup
# Velocitas Package for DevContainer Setup

Repo for Devcontainer Configuration and vehicle model generation on container startup.

## Components in this package

* [Basic Setup](./setup/README.md)
* [gRPC Interface Support](./grpc-service-support/README.md)
* [Vehicle Signal Interface Support](./vehicle-model-lifecycle/README.md)
1 change: 0 additions & 1 deletion grpc-service-support/test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ def pytest_sessionstart(session):
subprocess.check_call(["python", "-m", "pip", "install", "conan==1.60.2"])

subprocess.check_call(["velocitas", "init", "-f", "-v"], stdin=subprocess.PIPE)
subprocess.check_call(["velocitas", "sync"], stdin=subprocess.PIPE)
24 changes: 24 additions & 0 deletions grpc-service-support/test/test_integration.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import subprocess
from typing import List


Expand All @@ -19,3 +20,26 @@ def test_grpc_package_is_generated():
assert os.path.exists(os.path.join(service_path, "conanfile.py"))
assert os.path.exists(os.path.join(service_path, "include"))
assert os.path.exists(os.path.join(service_path, "src"))


def test_project_depends_on_grpc_package():
# Use a number rather than a bool to ensure
# the generator has added the dependency only
# once.
dependency_count = 0
in_requires_section = False
for line in open("./conanfile.txt"):
if line.trim() == "[requires]":
in_requires_section = True
elif line.startswith("["):
in_requires_section = False

if in_requires_section and line.trim() == "seats-service-sdk/auto":
dependency_count = dependency_count + 1

assert dependency_count == 1


def test_project_is_buildable():
assert subprocess.check_call(["./install_dependencies.sh"]) == 0
assert subprocess.check_call(["./build.sh"]) == 0
1 change: 1 addition & 0 deletions setup/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Basic Setup
2 changes: 1 addition & 1 deletion setup/test/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def test_files_synced():
changed_file.find(f"setup/src/{language}") != -1
)

subprocess.check_call(["velocitas", "init", "-f", "-v"])
subprocess.check_call(["velocitas", "init", "-f", "-v"], stdin=subprocess.PIPE)
subprocess.check_call(["velocitas", "sync"])

git_status_output = subprocess.check_output(
Expand Down
1 change: 1 addition & 0 deletions vehicle-model-lifecycle/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Vehicle Signal Interface Support
2 changes: 2 additions & 0 deletions vehicle-model-lifecycle/test/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import subprocess


def pytest_sessionstart(session):
Expand All @@ -8,3 +9,4 @@ def pytest_sessionstart(session):
"""

os.chdir(os.environ["VELOCITAS_TEST_ROOT"])
subprocess.check_call(["velocitas", "init", "-f", "-v"], stdin=subprocess.PIPE)

0 comments on commit 7eb1b72

Please sign in to comment.