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

2 doctests failures with external software octave #34607

Closed
seblabbe opened this issue Sep 29, 2022 · 9 comments
Closed

2 doctests failures with external software octave #34607

seblabbe opened this issue Sep 29, 2022 · 9 comments

Comments

@seblabbe
Copy link
Contributor

With 9.8.beta0, the command

sage -t --optional=sage,external src/sage/interfaces/octave.py

gives

Using --optional=external,sage
Features to be detected: 4ti2,benzene,bliss,buckygen,conway_polynomials,cplex,csdp,database_cremona_ellcurve,database_cremona_mini_ellcurve,database_cubic_hecke,database_jones_numfield,database_knotinfo,dvipng,ffmpeg,gfan,graphviz,gurobi,imagemagick,internet,jupymake,kenzo,latex,latex_package_tkz_graph,latte_int,lrslib,lualatex,macaulay2,magma,maple,mathematica,matlab,mcqd,meataxe,msolve,nauty,octave,palp,pandoc,pdf2svg,pdflatex,pdftocairo,phitigra,plantri,polytopes_db,polytopes_db_4d,pynormaliz,python_igraph,rubiks,sage.combinat,sage.geometry.polyhedron,sage.graphs,sage.groups,sage.misc.cython,sage.plot,sage.rings.number_field,sage.rings.padics,sage.rings.real_double,sage.symbolic,sage_numerical_backends_coin,sagemath_doc_html,scilab,sphinx,tdlib,xelatex
Doctesting 1 file.
sage -t --random-seed=300683574861759875953529709931492404030 src/sage/interfaces/octave.py
**********************************************************************
File "src/sage/interfaces/octave.py", line 159, in sage.interfaces.octave.Octave
Failed example:
    octave.eval("a = [ 1, 1, 2; 3, 5, 8; 13, 21, 33 ]")    # optional - octave
Expected:
    'a =\n\n 1 1 2\n 3 5 8\n 13 21 33\n'
Got:
    'a =\n\n 1 1 2\n 3 5 8\n 13 21 33\n\n'
**********************************************************************
File "src/sage/interfaces/octave.py", line 161, in sage.interfaces.octave.Octave
Failed example:
    octave.eval("b = [ 1; 3; 13]")                         # optional - octave
Expected:
    'b =\n\n 1\n 3\n 13\n'
Got:
    'b =\n\n 1\n 3\n 13\n\n'
**********************************************************************
1 item had failures:
   2 of   8 in sage.interfaces.octave.Octave
    [132 tests, 2 failures, 0.77 s]
----------------------------------------------------------------------
sage -t --random-seed=300683574861759875953529709931492404030 src/sage/interfaces/octave.py  # 2 doctests failed
----------------------------------------------------------------------
Total time for all tests: 0.9 seconds
    cpu time: 0.3 seconds
    cumulative wall time: 0.8 seconds
Features detected for doctesting: octave

The octave on the machine is:

$ octave --version
octave: X11 DISPLAY environment variable not set
octave: disabling GUI features
GNU Octave, version 4.2.2
Copyright (C) 2018 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.

Octave was configured for "x86_64-pc-linux-gnu".

Additional information about Octave is available at http://www.octave.org.

Please contribute if you find this software useful.
For more information, visit http://www.octave.org/get-involved.html

Read http://www.octave.org/bugs.html to learn how to submit bug reports.

A recent ticket also fixing octave doctests failures is #33093

CC: @jhpalmieri

Component: doctest coverage

Author: Sébastien Labbé

Branch/Commit: d46a7fc

Reviewer: John Palmieri

Issue created by migration from https://trac.sagemath.org/ticket/34607

@seblabbe seblabbe added this to the sage-9.8 milestone Sep 29, 2022
@seblabbe
Copy link
Contributor Author

comment:1

In #33093, I was using GNU Octave, version 5.2.0. Here, I am using another machine which uses GNU Octave, version 4.2.2.

GNU Octave, version 5.2.0 returns strings ending with "\n".

GNU Octave, version 4.2.2 returns strings ending with "\n\n".

Proposed solution: let's strip the strings. I will post a branch soon.

@seblabbe
Copy link
Contributor Author

Commit: d46a7fc

@seblabbe
Copy link
Contributor Author

Branch: u/slabbe/34607

@seblabbe
Copy link
Contributor Author

Author: Sébastien Labbé

@seblabbe
Copy link
Contributor Author

New commits:

d46a7fc34607: more robust octave doctests

@seblabbe
Copy link
Contributor Author

comment:3

I am trying to add John Palmieri in cc. Hopefully, my guess for his username "jpalmieri" is okay? Strangely, I can't find the username in the wiki page?

@jhpalmieri
Copy link
Member

comment:5

This works for me, and it should work regardless of how many \n's octave inserts at the end.

@jhpalmieri
Copy link
Member

Reviewer: John Palmieri

@vbraun
Copy link
Member

vbraun commented Oct 11, 2022

Changed branch from u/slabbe/34607 to d46a7fc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants