Skip to content

Commit

Permalink
Duplicate integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
erikbosch committed Mar 6, 2024
1 parent c8fb4ee commit fa070d6
Show file tree
Hide file tree
Showing 93 changed files with 51,474 additions and 69 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# * SPDX-License-Identifier: Apache-2.0
# ********************************************************************************/

name: integration-test
name: hvac-integration-test

on:
workflow_dispatch:
Expand Down Expand Up @@ -46,27 +46,14 @@ jobs:
- name: Install dependencies
shell: bash
run: |
.github/workflows/scripts/install-ci-tooling.sh
- name: Build seat_service image
shell: bash
working-directory: ./seat_service
run: |
./docker-build.sh -l x86_64
.github/workflows/scripts/hvac-install-ci-tooling.sh
- name: Build hvac_service image
shell: bash
working-directory: ./hvac_service
run: |
./docker-build.sh -l x86_64
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Setup VAL containers
shell: bash
env:
Expand All @@ -75,17 +62,16 @@ jobs:
# affecting integration tests for this repository
# The file specified must exist in the Databroker container
# KDB_OPT: "--vss vss_release_3.1.1.json"
SEAT_TAG: "prerelease"
HVAC_TAG: "prerelease"
run: |
./integration_test/it-setup.sh init
if ! ./integration_test/it-setup.sh start; then
./hvac_service/integration_test/it-setup.sh init
if ! ./hvac_service/integration_test/it-setup.sh start; then
echo "### Container startup failed logs:"
./integration_test/it-setup.sh status --logs
./hvac_service/integration_test/it-setup.sh status --logs
exit 1
fi
sleep 1
./integration_test/it-setup.sh status --logs
./hvac_service/integration_test/it-setup.sh status --logs
# echo "$ docker image ls"
# docker image ls
# echo "$ docker ps -a"
Expand All @@ -96,9 +82,9 @@ jobs:
- name: Install Requirements
shell: bash
run: |
pip3 install -U -r integration_test/requirements.txt
pip3 install -U -r hvac_service/integration_test/requirements.txt
pip3 install -U -e hvac_service/
pip3 install -U -e integration_test/
pip3 install -U -e hvac_service/integration_test/
- name: Run Integration Tests
shell: bash
Expand Down Expand Up @@ -130,7 +116,7 @@ jobs:
- name: Integration logs and cleanup
shell: bash
run: |
./integration_test/it-setup.sh status --logs
./integration_test/it-setup.sh cleanup --force
./hvac_service/integration_test/it-setup.sh status --logs
./hvac_service/integration_test/it-setup.sh cleanup --force
docker image ls
docker ps -a
62 changes: 62 additions & 0 deletions .github/workflows/scripts/seat-install-ci-tooling.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/bin/bash
#********************************************************************************
# Copyright (c) 2022 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License 2.0 which is available at
# http://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
#*******************************************************************************/

# To prevent interactive shells
export ENV DEBIAN_FRONTEND=noninteractive

# Install apt & root utils needed inside devcontainer
sudo apt-get -qqy update &&
sudo apt-get -qqy install --no-install-recommends apt-utils software-properties-common sudo curl file

# Install dev utilities
sudo apt-get -qqy install --no-install-recommends git doxygen can-utils python3

# Install build tools
sudo apt-get -qqy install --no-install-recommends \
cmake \
make

# compilers
# compiler version must be sync with conan build profile
sudo apt-get -qqy install --no-install-recommends \
g++ \
g++-aarch64-linux-gnu

sudo apt-get -qqy install --no-install-recommends \
lcov \
gcovr \
clang-format \
cppcheck \
valgrind

# Install PIP
[ -z "$(which pip3)" ] && sudo apt-get -qqy install --no-install-recommends --fix-missing python3-pip

# Default pip and setuptools are too old...
pip3 install --upgrade pip setuptools

# conan: dependency management
# - conan needed > 1.43 for gtest
# - conan >= 2.0 breaks commandline interface
# cantools: code generation from .dbc file
pip3 install \
'conan==1.56.0' \
'cantools==37.0.1'

# install docker
# curl -fsSL https://get.docker.com -o - | bash -
# docker --version

echo "### Running on:"
cat /etc/os-release
121 changes: 121 additions & 0 deletions .github/workflows/seat_integration_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# /********************************************************************************
# * Copyright (c) 2022 Contributors to the Eclipse Foundation
# *
# * See the NOTICE file(s) distributed with this work for additional
# * information regarding copyright ownership.
# *
# * This program and the accompanying materials are made available under the
# * terms of the Apache License 2.0 which is available at
# * http://www.apache.org/licenses/LICENSE-2.0
# *
# * SPDX-License-Identifier: Apache-2.0
# ********************************************************************************/

name: seat-integration-test

on:
workflow_dispatch:
push:
# Run only on branches/commits and not tags
branches:
- main
pull_request:
branches:
- main

jobs:
integration-test:
# reduce runtime requirements from libc/libc++
runs-on: ubuntu-20.04
# container:
# image: ghcr.io/${{ github.repository }}/oci_kuksa-val-services-ci:v0.1.0
# credentials:
# username: ${{ github.repository_owner }}
# password: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Adding github workspace as safe directory
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
git config --global user.email "github-automation@users.noreply.github.com"
git config --global user.name "Github Automation"
- name: Checkout Repository
uses: actions/checkout@v4

- name: Install dependencies
shell: bash
run: |
.github/workflows/scripts/seat-install-ci-tooling.sh
- name: Build seat_service image
shell: bash
working-directory: ./seat_service
run: |
./docker-build.sh -l x86_64
- name: Setup VAL containers
shell: bash
env:
# We may need to specify a VSS version compatible with the code in this repository
# This is needed if the default VSS version used by Databroker has backward incompatible changes
# affecting integration tests for this repository
# The file specified must exist in the Databroker container
# KDB_OPT: "--vss vss_release_3.1.1.json"
SEAT_TAG: "prerelease"
run: |
./seat_service/integration_test/it-setup.sh init
if ! ./seat_service/integration_test/it-setup.sh start; then
echo "### Container startup failed logs:"
./seat_service/integration_test/it-setup.sh status --logs
exit 1
fi
sleep 1
./seat_service/integration_test/it-setup.sh status --logs
# echo "$ docker image ls"
# docker image ls
# echo "$ docker ps -a"
# docker ps -a
# echo "$ docker inspect val-int"
# docker inspect val-int
- name: Install Requirements
shell: bash
run: |
pip3 install -U -r seat_service/integration_test/requirements.txt
pip3 install -U -e seat_service/integration_test/
- name: Run Integration Tests
shell: bash
env:
# force using it-setup.sh (testing with ghcr.io tags), DAPR standalone mode does not work in CI
USE_DAPR: "0"
GRPC_ENABLE_FORK_SUPPORT: "false"
run: |
pytest -v ./integration_test --asyncio-mode=auto \
--override-ini junit_family=xunit1 --junit-xml=./results/IntegrationTest/junit.xml \
--log-file=./results/IntegrationTest/integration.log --log-file-level=DEBUG
# Step below disabled, only triggered for pull requests internally within repository
# and that is typically not used, and is not working as action does not have sufficient permissions
# - name: Publish Integration Test Results
# uses: EnricoMi/publish-unit-test-result-action@v2
# if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
# with:
# files: ./results/IntegrationTest/junit.xml

- name: Upload Integration Test Logs
uses: actions/upload-artifact@v3
if: always()
with:
name: integration_test.log
path: |
./results/IntegrationTest/integration.log
- name: Integration logs and cleanup
shell: bash
run: |
./seat_service/integration_test/it-setup.sh status --logs
./seat_service/integration_test/it-setup.sh cleanup --force
docker image ls
docker ps -a
33 changes: 11 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,19 @@
# KUKSA.VAL.services
# KUKSA Incubation

- [KUKSA.VAL.services](#kuksavalservices)
- [Overview](#overview)
- [Contribution](#contribution)
- [Build Seat Service Containers](#build-seat-service-containers)
- [Running Seat Service / Data Broker Containers](#running-seat-service--data-broker-containers)
- [KUKSA.val and VSS version dependency](#kuksaval-and-vss-version-dependency)
- [Known locations where an explicit VSS or KUKSA.val version is mentioned](#known-locations-where-an-explicit-vss-or-kuksaval-version-is-mentioned)
![KUKSA Logo](./assets/logo.png)

## Overview
This is a KUKSA repository for incubation components.
That is components that as of today is not intended for production purposes.
They could however be useful as design-base or for demo-purposes.

This repository provides you a set of example **vehicle services** showing how to define and implement these important pieces of the **Eclipse KUKSA Vehicle Abstraction Layer (VAL)**.
[KUKSA.val](https://github.com/eclipse/kuksa.val) is offering a *Vehicle API*, which is an abstraction of vehicle data and functions to be used by *Vehicle Apps*.
Vehicle data is provided in form of a data model, which is accessible via the [KUKSA.val Databroker](https://github.com/eclipse/kuksa.val/tree/master/kuksa_databroker).
Vehicle functions are made available by a set of so-called *vehicle services* (short: *vservice*).
Some implications on that this is a repository for incubation components

You'll find a more [detailed overview here](docs/README.md).

This repository contains examples of vservices and their implementations to show, how a Vehicle API and the underlying abstraction layer could be realized.
It currently consists of
* a simple example [HVAC service](./hvac_service) written in Python and
* a more complex example [seat control service](./seat_service) written in C/C++.
* a [mock service](./mock_service/) written in Python to define execute mocking behavior defined in a Python-based DSL

More elaborate or completely differing implementations are target of "real world grown" projects.
* Vulnerability Management (Dependabot) is not enabled for this repository.
* Limited effort spent on artifacts like Bill-of-Material and Open Source Scanning
* Limited effort spent on testing before creating tags and releases

Incubation components may be promoted to "real components" in a separate repository if there
is a strong interest in the component and active maintainers/contributors willing to maintain the component.

## Contribution

Expand Down
Binary file added assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit fa070d6

Please sign in to comment.