Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring parallelism into tests #382

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 76 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,99 @@ version: 2.1
orbs:
win: circleci/windows@5.0 # The Windows orb gives you everything you need to start using the

commands:
install_dependencies:
parameters:
compiler:
default: ""
type: string
steps:
- run: chmod u+x install_dependencies.sh && ./install_dependencies.sh <<parameters.compiler>>
compile_tests:
parameters:
compiler:
default: ""
type: string
steps:
- run: chmod u+x compile_tests.sh && ./compile_tests.sh <<parameters.compiler>>
run_tests:
steps:
- run: pytest erpcgen/test/
- run: python3 test/run_unit_tests.py

jobs:
build-linux-gcc:
machine:
image: ubuntu-2204:2022.04.2 #https://circleci.com/developer/machine/image/ubuntu-2204 pick LTS
steps:
- checkout
- run: chmod u+x install_dependencies.sh && ./install_dependencies.sh
- run: chmod u+x run_tests.sh && ./run_tests.sh
- install_dependencies
- compile_tests
- store_artifacts:
path: ./Release/Linux/erpcgen/erpcgen
test-linux-gcc:
machine:
image: ubuntu-2204:2022.04.2 #https://circleci.com/developer/machine/image/ubuntu-2204 pick LTS
parallelism: 2
steps:
- checkout
- run_tests

build-linux-clang:
machine:
image: ubuntu-2204:2022.04.2 #https://circleci.com/developer/machine/image/ubuntu-2204 pick LTS
steps:
- checkout
- run: chmod u+x install_dependencies.sh && ./install_dependencies.sh clang
- run: chmod u+x run_tests.sh && ./run_tests.sh clang
- install_dependencies:
compiler: "clang"
- compile_tests:
compiler: "clang"
# - store_artifacts:
# path: ./Release/Linux/erpcgen/erpcgen
test-linux-clang:
machine:
image: ubuntu-2204:2022.04.2 #https://circleci.com/developer/machine/image/ubuntu-2204 pick LTS
parallelism: 2
steps:
- checkout
- run_tests

build-mac-gcc:
macos:
xcode: 12.5.1 # https://circleci.com/docs/using-macos/#supported-xcode-versions https://en.wikipedia.org/wiki/MacOS_version_history#Releases
resource_class: macos.x86.medium.gen2
steps:
- checkout
- run: chmod u+x install_dependencies.sh && ./install_dependencies.sh
- run: chmod u+x run_tests.sh && ./run_tests.sh
- install_dependencies
- compile_tests
- store_artifacts:
path: ./Release/Darwin/erpcgen/erpcgen
test-mac-gcc:
macos:
xcode: 12.5.1 # https://circleci.com/docs/using-macos/#supported-xcode-versions https://en.wikipedia.org/wiki/MacOS_version_history#Releases
parallelism: 2
steps:
- checkout
- run_tests

build-mac-clang:
macos:
xcode: 12.5.1 # https://circleci.com/docs/using-macos/#supported-xcode-versions https://en.wikipedia.org/wiki/MacOS_version_history#Releases
resource_class: macos.x86.medium.gen2
steps:
- checkout
- run: chmod u+x install_dependencies.sh && ./install_dependencies.sh clang
- run: chmod u+x run_tests.sh && ./run_tests.sh clang
- install_dependencies:
compiler: "clang"
- compile_tests:
compiler: "clang"
test-mac-clang:
macos:
xcode: 12.5.1 # https://circleci.com/docs/using-macos/#supported-xcode-versions https://en.wikipedia.org/wiki/MacOS_version_history#Releases
parallelism: 2
steps:
- checkout
- run_tests

# - store_artifacts:
# path: ./Release/Darwin/erpcgen/erpcgen
build-windows-mingw:
Expand Down Expand Up @@ -70,8 +126,20 @@ workflows:
build-workflow:
jobs:
- build-linux-gcc
- test-linux-gcc:
requires:
- build-linux-gcc
- build-linux-clang
- test-linux-clang:
requires:
- build-linux-clang
- build-mac-gcc
- test-mac-gcc:
requires:
- build-mac-gcc
- build-mac-clang
- test-mac-clang:
requires:
- build-mac-clang
- build-windows-mingw
- build-windows-VS
13 changes: 13 additions & 0 deletions compile_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

# exit when any command fails
set -e

make clean
if [ "$1" = "clang" ]; then
echo "Compiling by clang compiler."
CC=clang CXX=clang++ make all
else
echo "Compiling by default gnu compiler."
CC=gcc CXX=g++ make all
fi
9 changes: 0 additions & 9 deletions run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,5 @@
# exit when any command fails
set -e

make clean
if [ "$1" = "clang" ]; then
echo "Compiling by clang compiler."
CC=clang CXX=clang++ make all
else
echo "Compiling by default gnu compiler."
CC=gcc CXX=g++ make all
fi

pytest erpcgen/test/
python3 test/run_unit_tests.py