Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dz-ci-prototype
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
poquet
dz-ci-prototype
Commits
d9aa1395
Commit
d9aa1395
authored
2 years ago
by
Millian Poquet
Browse files
Options
Downloads
Patches
Plain Diff
unit tests++
parent
da0a4ed0
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#4503
passed
2 years ago
Stage: unique_stage
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitlab-ci.yml
+9
-2
9 additions, 2 deletions
.gitlab-ci.yml
client-py/client.py
+3
-0
3 additions, 0 deletions
client-py/client.py
client-py/test_client.py
+6
-0
6 additions, 0 deletions
client-py/test_client.py
default.nix
+9
-0
9 additions, 0 deletions
default.nix
with
27 additions
and
2 deletions
.gitlab-ci.yml
+
9
−
2
View file @
d9aa1395
...
@@ -11,7 +11,10 @@ debian:
...
@@ -11,7 +11,10 @@ debian:
script
:
script
:
# Get various dependencies
# Get various dependencies
-
apt update -y
-
apt update -y
-
apt install -y g++ libsimgrid-dev libzmq3-dev libprotobuf-dev protobuf-compiler libgtest-dev meson ninja-build pkg-config python3 python3-pip
-
apt install -y g++ libsimgrid-dev libzmq3-dev libprotobuf-dev protobuf-compiler libgtest-dev meson ninja-build pkg-config python3 python3-pip python3-pytest
# Put pip-installed binaries in PATH
-
export PATH="${PATH}:/usr/local/bin"
# Build protocol (c++)
# Build protocol (c++)
-
(cd protocol && meson setup build --prefix=/usr && ninja -C build && meson install -C build)
-
(cd protocol && meson setup build --prefix=/usr && ninja -C build && meson install -C build)
...
@@ -29,10 +32,13 @@ debian:
...
@@ -29,10 +32,13 @@ debian:
# Run unit tests (simgrid simulator, c++)
# Run unit tests (simgrid simulator, c++)
-
(cd simgrid-simulator && meson test -C build)
-
(cd simgrid-simulator && meson test -C build)
# Run unit tests (python)
-
(cd client-py && pytest .)
# Run integration tests (simgrid simulator VS c++ client)
# Run integration tests (simgrid simulator VS c++ client)
-
test/simulator-cpp-client.sh
-
test/simulator-cpp-client.sh
# Run integration tests (simgrid simulator VS python client)
# Run integration tests (simgrid simulator VS python client)
-
PATH="${PATH}:/usr/local/bin"
test/simulator-py-client.sh
-
test/simulator-py-client.sh
artifacts
:
artifacts
:
paths
:
paths
:
-
client-cpp.err
-
client-cpp.err
...
@@ -54,5 +60,6 @@ nix:
...
@@ -54,5 +60,6 @@ nix:
# Any dependency will also be built, for example the following command also builds protocol-python
# Any dependency will also be built, for example the following command also builds protocol-python
-
nix-build . -A client-py
-
nix-build . -A client-py
# Therefore one can just run its desired leaf of the build tree, such as:
# Therefore one can just run its desired leaf of the build tree, such as:
-
nix-shell . -A client-py_unittest_shell --command '(cd client-py && pytest)'
-
nix-shell . -A integration_shell_cpp --command './test/simulator-cpp-client.sh'
-
nix-shell . -A integration_shell_cpp --command './test/simulator-cpp-client.sh'
-
nix-shell . -A integration_shell_py --command './test/simulator-py-client.sh'
-
nix-shell . -A integration_shell_py --command './test/simulator-py-client.sh'
This diff is collapsed.
Click to expand it.
client-py/client.py
+
3
−
0
View file @
d9aa1395
...
@@ -2,6 +2,9 @@
...
@@ -2,6 +2,9 @@
import
zmq
import
zmq
import
protocol.hello_pb2
as
proto
import
protocol.hello_pb2
as
proto
def
some_function
(
x
):
return
x
*
2
def
main
():
def
main
():
context
=
zmq
.
Context
()
context
=
zmq
.
Context
()
socket
=
context
.
socket
(
zmq
.
REP
)
socket
=
context
.
socket
(
zmq
.
REP
)
...
...
This diff is collapsed.
Click to expand it.
client-py/test_client.py
0 → 100644
+
6
−
0
View file @
d9aa1395
#!/usr/bin/env python3
import
client
def
test_some_function
():
for
i
in
range
(
10
):
assert
(
client
.
some_function
(
i
)
==
i
*
2
)
This diff is collapsed.
Click to expand it.
default.nix
+
9
−
0
View file @
d9aa1395
...
@@ -44,7 +44,11 @@ let self = rec {
...
@@ -44,7 +44,11 @@ let self = rec {
"src"
"src"
"src/.*
\.
cpp"
"src/.*
\.
cpp"
"src/.*
\.
hpp"
"src/.*
\.
hpp"
"test"
"test/.*
\.
cpp"
];
];
mesonFlags
=
[
"-Ddo_unit_tests=true"
];
doCheck
=
true
;
buildInputs
=
with
pkgs
;
[
buildInputs
=
with
pkgs
;
[
simgrid
simgrid
protocol-cpp
protocol-cpp
...
@@ -85,6 +89,11 @@ let self = rec {
...
@@ -85,6 +89,11 @@ let self = rec {
];
];
};
};
client-py_unittest_shell
=
pkgs
.
mkShell
{
buildInputs
=
client-py
.
propagatedBuildInputs
++
[
pythonPackages
.
pytest
];
};
integration_shell_cpp
=
pkgs
.
mkShell
{
integration_shell_cpp
=
pkgs
.
mkShell
{
buildInputs
=
[
buildInputs
=
[
simgrid-simulator
simgrid-simulator
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment