Skip to content

added test reqs to readme #496

added test reqs to readme

added test reqs to readme #496

This check has been archived and is scheduled for deletion. Learn more about checks retention
GitHub Actions / JUnit Test Report failed Sep 14, 2023 in 0s

70 tests run, 68 passed, 0 skipped, 2 failed.

Annotations

Check failure on line 46 in test/simple_sim_test.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

simple_sim_test.test_opts

failed on setup with "file /home/runner/work/nosnoc_py/nosnoc_py/test/simple_sim_test.py, line 46
  def test_opts(opts, model):
E       fixture 'opts' not found
>       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
>       use 'pytest --fixtures [testpath]' for help on them.

/home/runner/work/nosnoc_py/nosnoc_py/test/simple_sim_test.py:46"
Raw output
file /home/runner/work/nosnoc_py/nosnoc_py/test/simple_sim_test.py, line 46
  def test_opts(opts, model):
E       fixture 'opts' not found
>       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
>       use 'pytest --fixtures [testpath]' for help on them.

/home/runner/work/nosnoc_py/nosnoc_py/test/simple_sim_test.py:46

Check failure on line 1 in SimpleTests

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

SimpleTests.test_sliding

Exception: test_sliding failed with setting:
 ns=2 Nfe=3 pss_mode=<PssMode.STEWART: 1> irk_scheme=<IrkSchemes.GAUSS_LEGENDRE: 2>
Raw output
self = <simple_sim_test.SimpleTests testMethod=test_sliding>

    def test_sliding(self):
        model = get_simplest_model_sliding()
    
        for ns in NS_VALUES:
            for Nfe in N_FINITE_ELEMENT_VALUES:
                for pss_mode in nosnoc.PssMode:
                    for irk_scheme in nosnoc.IrkSchemes:
                        opts = get_default_options()
                        opts.step_equilibration = nosnoc.StepEquilibrationMode.HEURISTIC_MEAN
                        opts.irk_scheme = irk_scheme
                        opts.print_level = 0
                        opts.n_s = ns
                        opts.N_finite_elements = Nfe
                        opts.pss_mode = pss_mode
                        try:
>                           test_opts(opts, model=model)

test/simple_sim_test.py:102: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

opts = terminal_time : 0.7853981633974483
use_fesd : True
print_level : 0
max_iter_homotopy : 10
initialization_strategy : In...1.73205081]
 [ 1.73205081]]
irk_time_points : [0.         0.21132487 0.78867513]
right_boundary_point_explicit : False

model = x : x1
alpha : None
theta : None
F : [DM([[3, -1]])]
f_x : None
g_z : 0x1
c : [SX(x1)]
S : [array([[-1],
       [ 1]])...tewart_fun : mu00_stewart_fun:(i0,i1[0])->(o0) SXFunction
g_Stewart_fun : g_Stewart_fun:(i0,i1[0])->(o0[2]) SXFunction


    def test_opts(opts, model):
        results = solve_simplest_example(opts=opts, model=model)
        errors = compute_errors(results, model)
    
        print(errors)
        tol = 1e1 * TOL
        assert errors["x0"] < tol
        assert errors["t_switch"] < tol
        assert errors["t_end"] < tol
>       assert errors["x_switch"] < tol
E       assert array([1.34263323e-08]) < 1e-08

test/simple_sim_test.py:55: AssertionError

During handling of the above exception, another exception occurred:

self = <simple_sim_test.SimpleTests testMethod=test_sliding>

    def test_sliding(self):
        model = get_simplest_model_sliding()
    
        for ns in NS_VALUES:
            for Nfe in N_FINITE_ELEMENT_VALUES:
                for pss_mode in nosnoc.PssMode:
                    for irk_scheme in nosnoc.IrkSchemes:
                        opts = get_default_options()
                        opts.step_equilibration = nosnoc.StepEquilibrationMode.HEURISTIC_MEAN
                        opts.irk_scheme = irk_scheme
                        opts.print_level = 0
                        opts.n_s = ns
                        opts.N_finite_elements = Nfe
                        opts.pss_mode = pss_mode
                        try:
                            test_opts(opts, model=model)
                        except:
>                           raise Exception(f"test_sliding failed with setting:\n {ns=} {Nfe=} {pss_mode=} {irk_scheme=}")
E                           Exception: test_sliding failed with setting:
E                            ns=2 Nfe=3 pss_mode=<PssMode.STEWART: 1> irk_scheme=<IrkSchemes.GAUSS_LEGENDRE: 2>

test/simple_sim_test.py:104: Exception