Skip to content

Commit

Permalink
Fix references to npf-run and path in integration
Browse files Browse the repository at this point in the history
  • Loading branch information
tbarbette committed Dec 19, 2024
1 parent 431c52f commit d4bcf15
Show file tree
Hide file tree
Showing 17 changed files with 50 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
pip install pytest
- name: Version
run: |
npf-run --version
npf --version
- name: Compilation test
run: |
python -m compileall -q npf *.py
Expand Down
12 changes: 6 additions & 6 deletions doc/build_graphs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

set -e

python3 ./npf-run.py --test integration/filter.npf --graph-size 4 2.5 --graph-filename doc/filter.png
python3 ./npf-run.py 'local:Default' --test doc/example_multiple_result.npf --graph-size 3 2.5 --graph-filename doc/example_multiple_result_default.png --force-retest
python3 ./npf-run.py 'local:Add' --test doc/example_multiple_result.npf --graph-size 3 2.5 --graph-filename doc/example_multiple_result_add.png --config 'result_add={THROUGHPUT}' --force-retest
python3 ./npf-run.py 'local:Append' --test doc/example_multiple_result.npf --graph-size 3 2.5 --graph-filename doc/example_multiple_result_append.png --config 'result_append={THROUGHPUT}' --force-retest
python3 ./npf-run.py local:Namespace --test doc/example_namespaces.npf --graph-size 4 2.5 --graph-filename doc/example_namespaces.svg
python3 ./npf-run.py 'local:Namespace (synced)' --test doc/example_namespaces.npf --graph-size 4 2.5 --graph-filename doc/example_namespaces_synced.svg --config 'var_sync={TIME}'
python3 ./npf.py --test integration/filter.npf --graph-size 4 2.5 --graph-filename doc/filter.png
python3 ./npf.py 'local:Default' --test doc/example_multiple_result.npf --graph-size 3 2.5 --graph-filename doc/example_multiple_result_default.png --force-retest
python3 ./npf.py 'local:Add' --test doc/example_multiple_result.npf --graph-size 3 2.5 --graph-filename doc/example_multiple_result_add.png --config 'result_add={THROUGHPUT}' --force-retest
python3 ./npf.py 'local:Append' --test doc/example_multiple_result.npf --graph-size 3 2.5 --graph-filename doc/example_multiple_result_append.png --config 'result_append={THROUGHPUT}' --force-retest
python3 ./npf.py local:Namespace --test doc/example_namespaces.npf --graph-size 4 2.5 --graph-filename doc/example_namespaces.svg
python3 ./npf.py 'local:Namespace (synced)' --test doc/example_namespaces.npf --graph-size 4 2.5 --graph-filename doc/example_namespaces_synced.svg --config 'var_sync={TIME}'
6 changes: 3 additions & 3 deletions integration/event.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ Executing init scripts...
[0] RESULT-X 1
[0] RESULT-Z 1
X: [1.0, 1.0, 1.0], Y: [1.0, 1.0, 1.0], Z: [1.0, 1.0, 1.0]
Graph of test written to results/click-2022/9197a59/event-X.pdf
Graph of test written to results/click-2022/9197a59/event-Y.pdf
Graph of test written to results/click-2022/9197a59/event-Z.pdf
Graph of test written to compare/event_click-2022-X.pdf
Graph of test written to compare/event_click-2022-Y.pdf
Graph of test written to compare/event_click-2022-Z.pdf
4 changes: 2 additions & 2 deletions integration/globsync.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ Executing init scripts...
[0] A-115-RESULT-V 5
[0] B-115-RESULT-V 50
No valid data for Build(repo = click-2022, version = 9197a59)
Graph of test written to results/click-2022/9197a59/globsync-A-V.pdf
Graph of test written to results/click-2022/9197a59/globsync-B-V.pdf
Graph of test written to compare/globsync_click-2022-A-V.pdf
Graph of test written to compare/globsync_click-2022-B-V.pdf
2 changes: 1 addition & 1 deletion integration/integration-01.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -848,4 +848,4 @@ BURST = 1024, LENGTH = 1024 [run 2/3 for test 121/121]
BURST = 1024, LENGTH = 1024 [run 3/3 for test 121/121]
[0] RESULT 1024
[1024.0, 1024.0, 1024.0]
Graph of test written to results/click-2022/9197a59/integration-01.pdf
Graph of test written to compare/integration_click-2022-01.pdf
2 changes: 1 addition & 1 deletion integration/integration-02.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,4 @@ BURST = 32, LENGTH = 1024 [run 3/3 for test 11/11]
[0] RESULT 32
[0] stop
[32.0, 32.0, 32.0]
Graph of test written to results/click-2022/9197a59/integration-02.pdf
Graph of test written to compare/integration_click-2022-02.pdf
4 changes: 2 additions & 2 deletions integration/jinja.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ PARALLEL = 4 [run 3/3 for test 1/1]
Result for R is 0 !
Result for F is 0 !
F: [6.0, 6.0, 6.0], R: [3.0, 3.0, 3.0]
Graph of test written to results/click-2022/9197a59/jinja-F.pdf
Graph of test written to results/click-2022/9197a59/jinja-R.pdf
Graph of test written to compare/jinja_click-2022-F.pdf
Graph of test written to compare/jinja_click-2022-R.pdf
6 changes: 3 additions & 3 deletions integration/math.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,6 @@ N = 32 [run 3/3 for test 32/32]
[0] RESULT-LOG 3.47
[0] RESULT-EXP 4294967296.0
EXP: [4294967296.0, 4294967296.0, 4294967296.0], LOG: [3.47, 3.47, 3.47], N: [32.0, 32.0, 32.0]
Graph of test written to results/click-2022/9197a59/math-EXP.pdf
Graph of test written to results/click-2022/9197a59/math-LOG.pdf
Graph of test written to results/click-2022/9197a59/math-N.pdf
Graph of test written to compare/math_click-2022-EXP.pdf
Graph of test written to compare/math_click-2022-LOG.pdf
Graph of test written to compare/math_click-2022-N.pdf
6 changes: 3 additions & 3 deletions integration/pyexit.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,6 @@ CPU = 8, R = 50, T = 100 [run 3/3 for test 8/8]
[0] RESULT-RX 50
[0] RESULT-TX 100
LOSS: [-50.0, -50.0, -50.0], RX: [50.0, 50.0, 50.0], TX: [100.0, 100.0, 100.0]
Graph of test written to results/click-2022/9197a59/pyexit-LOSS.pdf
Graph of test written to results/click-2022/9197a59/pyexit-RX.pdf
Graph of test written to results/click-2022/9197a59/pyexit-TX.pdf
Graph of test written to compare/pyexit_click-2022-LOSS.pdf
Graph of test written to compare/pyexit_click-2022-RX.pdf
Graph of test written to compare/pyexit_click-2022-TX.pdf
4 changes: 2 additions & 2 deletions integration/sshtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ fi
set -e

mkdir -p /tmp/npf
python3 ./npf-run.py local/$(pwd)/libs/ --test integration/localcopy.npf --cluster [email protected]:/tmp/npf/,nfs=0 --show-all --force-retest
python3 ./npf.py local/$(pwd)/libs/ --test integration/localcopy.npf --cluster [email protected]:/tmp/npf/,nfs=0 --show-all --force-retest
rm -rf /tmp/npf


python3 ./npf-run.py local/$(pwd)/libs/ --test integration/localcopy.npf --cluster [email protected] --show-all --force-retest
python3 ./npf.py local/$(pwd)/libs/ --test integration/localcopy.npf --cluster [email protected] --show-all --force-retest


2 changes: 1 addition & 1 deletion integration/timeout-overwrite.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ Executing init scripts...
[run 1/1 for test 1/1]
[0] RESULT 1
[1.0]
Graph of test written to results/click-2022/9197a59/timeout-overwrite.pdf
Graph of test written to compare/timeout_click-2022-overwrite.pdf
6 changes: 3 additions & 3 deletions integration/zlt.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,6 @@ THRESH = 90, RATE = 90 [run 3/3 for test 11/~12(max 57)]
[0] RESULT-GOODPC 100
[0] RESULT-THROUGHPUT 90
DROPPEDPC: [0.0, 0.0, 0.0], GOODPC: [100.0, 100.0, 100.0], THROUGHPUT: [90.0, 90.0, 90.0]
Graph of test written to results/click-2022/9197a59/zlt-DROPPEDPC.pdf
Graph of test written to results/click-2022/9197a59/zlt-GOODPC.pdf
Graph of test written to results/click-2022/9197a59/zlt-THROUGHPUT.pdf
Graph of test written to compare/zlt_click-2022-DROPPEDPC.pdf
Graph of test written to compare/zlt_click-2022-GOODPC.pdf
Graph of test written to compare/zlt_click-2022-THROUGHPUT.pdf
1 change: 0 additions & 1 deletion npf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import npf.osutils
import npf.parsing
from npf.repo.factory import get_default_repository
from npf.repo.factory import get_default_repository
from npf.tests.test_driver import Comparator
from npf.output import generate_outputs
from npf.tests.regression import *
Expand Down
24 changes: 14 additions & 10 deletions npf/enoslib.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
from typing import Dict, List
import enoslib as en

import npf.cluster.node
import npf.cmdline
import npf.globals
import npf.parsing
from npf.repo.repository import Repository
from npf.repo.factory import get_default_repository
from npf.cluster.node import Node
from npf.output import generate_outputs
from npf.output.grapher import Grapher
from npf.test_driver import Comparator, group_series
from npf.node import Node
from npf.tests.test_driver import Comparator
import npf
import argparse
from npf import repository

def run(npf_script, roles:Dict[str,en.Host], argsv: List[str] = None):
if argsv is None:
Expand All @@ -23,14 +23,13 @@ def run(npf_script, roles:Dict[str,en.Host], argsv: List[str] = None):
b = npf.cmdline.add_building_options(parser)
t = npf.cmdline.add_testing_options(parser, regression=False)
a = npf.cmdline.add_graph_options(parser)
parser.add_argument('repos', metavar='repo', type=str, nargs='+', help='names of the repositories to compares. Use a format such as repo+VAR=VAL:Title to overwrite variables and serie name.')
parser.add_argument('repos', metavar='repo', type=str, nargs='*', help='names of the repositories to compares. Use a format such as repo+VAR=VAL:Title to overwrite variables and serie name.')
parser.add_argument('--graph-title', type=str, nargs='?', help='Graph title')

full_args = ["--test", npf_script]
full_args.extend(argsv)
full_args = ["--test", npf_script, *argsv]
args = parser.parse_args(full_args)
npf.parsing.initialize(args)
npf.cluster.node.create_local()
npf.parsing.create_local()

#en.set_config(ansible_stdout="regular")

Expand All @@ -46,7 +45,10 @@ def run(npf_script, roles:Dict[str,en.Host], argsv: List[str] = None):

repo_list = []
for repo_name in args.repos:
repo = repository.Repository.get_instance(repo_name, args)
repo = Repository.get_instance(repo_name, args)
repo_list.append(repo)
if not repo_list:
repo = get_default_repository(args)
repo_list.append(repo)

comparator = Comparator(repo_list)
Expand All @@ -59,4 +61,6 @@ def run(npf_script, roles:Dict[str,en.Host], argsv: List[str] = None):

filename = npf.build_output_filename(repo_list)

generate_outputs(filename, args, series, time_series, options=args)
generate_outputs(filename, series=series, time_series=time_series, options=args)

return series, time_series
6 changes: 4 additions & 2 deletions npf/executor/enoslibexecutor.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ def exec(self, cmd : str, bin_paths : List[str]=[],
if not title:
title = self.machine.address

print(cmd)

env = env.copy()
env.update(os.environ)
if bin_paths:
Expand All @@ -66,6 +64,10 @@ def exec(self, cmd : str, bin_paths : List[str]=[],
else:
cmd = virt + " bash -c '"+ cmd.replace("'", "'\"'\"'") + "'";

killer = EnoslibKiller(pgpid)
if queue:
queue.put(killer)

try:
p = en.run_command(cmd, roles=self.machine)
except en.errors.EnosFailedHostsError as e:
Expand Down
2 changes: 2 additions & 0 deletions npf/output/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,12 @@ def generate_outputs(filename: str, series: Series , time_series:Series, options
print("Generating graphs...")

pypost.execute_pypost(series=series)

g = grapher.graph(series=series,
filename=filename,
options=options,
title=options.graph_title)

if options.do_time:
for time_ns,series in n_time_series.items():
print(f"Generating graph for time serie '{time_ns}'...")
Expand Down
4 changes: 2 additions & 2 deletions npf_watch.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env python3
"""
NPF repository watcher. Essentially a loop watching for commits in a list of git repo to execute given tests when
a commit is made. If you want to integrate npf in your CI test suite, use npf-run. Passive watching is intended
a commit is made. If you want to integrate npf in your CI test suite, use npf.py. Passive watching is intended
to watch project you don't own but you use, just to be sure that they do not mess performances.
We prefered to separate this tool from npf-run because of the lot of specifics for sending an e-mail, watch loop, etc
We prefered to separate this tool from npf.py because of the lot of specifics for sending an e-mail, watch loop, etc
"""
import argparse
import smtplib
Expand Down

0 comments on commit d4bcf15

Please sign in to comment.