Skip to content

Commit

Permalink
Merge branch 'main' into refactor/simplify_evse_manager_error_handlin…
Browse files Browse the repository at this point in the history
…g_further
  • Loading branch information
Pietfried authored Dec 3, 2024
2 parents 6a49e4f + 2b9d96d commit bb94d46
Show file tree
Hide file tree
Showing 256 changed files with 30,325 additions and 3,851 deletions.
25 changes: 25 additions & 0 deletions .ci/build-kit/scripts/create_ocpp_tests_image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh

rsync -a "$EXT_MOUNT/source/tests" ./
retVal=$?

if [ $retVal -ne 0 ]; then
echo "Failed to copy tests"
exit $retVal
fi

pip install --break-system-packages \
"$EXT_MOUNT"/wheels/everestpy-*.whl \
"$EXT_MOUNT"/wheels/everest_testing-*.whl \
"$EXT_MOUNT"/wheels/iso15118-*.whl \
pytest-html
retVal=$?

if [ $retVal -ne 0 ]; then
echo "Failed to pip-install"
exit $retVal
fi

pip install --break-system-packages -r tests/ocpp_tests/requirements.txt

$(cd ./tests/ocpp_tests/test_sets/everest-aux/ && ./install_certs.sh "$EXT_MOUNT/dist" && ./install_configs.sh "$EXT_MOUNT/dist")
25 changes: 25 additions & 0 deletions .ci/e2e/scripts/run_ocpp_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh

cd tests

PARALLEL_TESTS=$(nproc)

echo "Running $PARALLEL_TESTS ocpp tests in parallel"

pytest \
-rA \
-d --tx "$PARALLEL_TESTS"*popen//python=python3 \
--max-worker-restart=0 \
--timeout=300 \
--junitxml="$EXT_MOUNT/ocpp-tests-result.xml" \
--html="$EXT_MOUNT/ocpp-tests-report.html" \
--self-contained-html \
ocpp_tests/test_sets/ocpp16/*.py \
ocpp_tests/test_sets/ocpp201/*.py \
--everest-prefix "$EXT_MOUNT/dist"
retVal=$?

if [ $retVal -ne 0 ]; then
echo "OCPP tests failed with return code $retVal"
exit $retVal
fi
91 changes: 91 additions & 0 deletions .github/workflows/build_and_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,94 @@ jobs:
do_not_run_coverage_badge_creation: true
run_install_wheels: true
run_integration_tests: true
ocpp-tests:
name: OCPP Tests
needs:
- ci
runs-on: ${{ inputs.runner || 'ubuntu-22.04' }}
steps:
- name: Download dist dir
uses: actions/[email protected]
with:
name: dist
- name: Extract dist.tar.gz
run: |
tar -xzf ${{ github.workspace }}/dist.tar.gz -C ${{ github.workspace }}
- name: Download wheels
# if: ${{ inputs.run_install_wheels == 'true' }}
uses: actions/[email protected]
with:
name: wheels
path: wheels
- name: Checkout repository
uses: actions/[email protected]
with:
path: source
- name: Setup run scripts
run: |
mkdir scripts
rsync -a source/.ci/build-kit/scripts/ scripts
- name: Docker Meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.BUILD_KIT_IMAGE_NAME }}
- name: Set output tag
id: buildkit_tag
shell: python3 {0}
run: |
import os
tags = "${{ steps.meta.outputs.tags }}".split(",")
if len(tags) == 0:
print("No tags found!❌")
exit(1)
tag = f"local/build-kit-everest-core:{tags[0]}"
with open(os.environ["GITHUB_OUTPUT"], "a") as f:
f.write(f"tag={tag}\n")
print(f"Set tag={tag}")
- name: Download build-kit image
uses: actions/download-artifact@v4
with:
name: build-kit
- name: Load build-kit image
run: |
docker load -i build-kit.tar
docker image tag ${{ steps.buildkit_tag.outputs.tag }} build-kit
- name: Create integration-image
run: |
docker run \
--volume "${{ github.workspace }}:/ext" \
--name integration-container \
build-kit run-script create_ocpp_tests_image
docker commit integration-container integration-image
- name: Run OCPP tests
id: run_ocpp_tests
continue-on-error: true
run: |
docker compose \
-f source/.ci/e2e/docker-compose.yaml \
run \
e2e-test-server \
run-script run_ocpp_tests
- name: Upload result and report as artifact
continue-on-error: true
if: ${{ steps.run_ocpp_tests.outcome == 'success' || steps.run_ocpp_tests.outcome == 'failure' }}
uses: actions/[email protected]
with:
if-no-files-found: error
name: ocpp-tests-report
path: |
ocpp-tests-result.xml
ocpp-tests-report.html
- name: Render OCPP tests result
if: ${{ steps.run_ocpp_tests.outcome == 'success' || steps.run_ocpp_tests.outcome == 'failure' }}
uses: pmeier/[email protected]
with:
path: ocpp-tests-result.xml
summary: True
display-options: fEX
fail-on-empty: True
title: Test results
- name: Check if OCPP tests failed
if: ${{ steps.run_ocpp_tests.outcome == 'failure' }}
run: exit 1
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.16)

project(everest-core
VERSION 2024.9.0
VERSION 2024.10.0
DESCRIPTION "The open operating system for e-mobility charging stations"
LANGUAGES CXX C
)
Expand Down Expand Up @@ -169,7 +169,7 @@ add_custom_target(install_everest_testing
if [ -z "${CPM_PACKAGE_everest-utils_SOURCE_DIR}" ] \;
then echo "Could not determine location of everest-utils, please install everest-testing manually!" \;
else echo "Found everest-utils at ${CPM_PACKAGE_everest-utils_SOURCE_DIR}" \;
${PYTHON_EXECUTABLE} -m pip install "${CPM_PACKAGE_everest-utils_SOURCE_DIR}/everest-testing" \;
${Python3_EXECUTABLE} -m pip install -e "${CPM_PACKAGE_everest-utils_SOURCE_DIR}/everest-testing" \;
fi\;
DEPENDS
everestpy_pip_install_dist
Expand Down
Loading

0 comments on commit bb94d46

Please sign in to comment.