Get `pkg test symbolic` working
I think there is a new pkg test ... feature upstream. We should use it, speed up the deprecation of octsympy_tests.
I'd like to see it used in our CI. C.f., #1141 and #1060.
And just checked and this now works, presumably b/c of the #1060 fix. So I guess we can use it in CI for example
Still seems to run tests for all packages not just symbolic :( Doesn't happen locally
Still seems to run tests for all packages not just symbolic :( Doesn't happen locally
~Running docker exec oc octave-cli --eval "pkg test symbolic" in CI actually works!~
Actually, I commented out the wrong line of code. Indeed, the command runs tests outside of symbolic.
Looks like an upstream bug to me. In m-file https://hg.savannah.gnu.org/hgweb/octave/file/04120d65778a/scripts/pkg/pkg.m, if we remove those ; in case "test"..., we can see the value of the variables:
installed_pkgs_lst =
{
[1,1] =
scalar structure containing the fields:
name = symbolic
version = 2.9.0+
date = 2021-10-16
author = Colin B. Macdonald <***@***.***>
maintainer = Colin B. Macdonald <***@***.***>
title = Octave Symbolic Package using SymPy
description = Adds symbolic calculation features to GNU Octave. These include common Computer Algebra System tools such as algebraic operations, calculus, equation solving, Fourier and Laplace transforms, variable precision arithmetic and other features. Compatibility with other symbolic toolboxes is intended.
categories = symbolic
url = https://octave.sourceforge.io/symbolic
depends =
{
[1,1] =
scalar structure containing the fields:
package = octave
operator = >=
version = 4.2
}
systemrequirements = python, sympy (>= 1.2), mpmath (>= 1.0)
license = GPL-3.0-or-later
dir = /usr/share/octave/packages/symbolic-2.9.0+
archprefix = /usr
loaded = 1
}
Testing functions in package 'symbolic':
installed_pkgs_dirs =
{
[1,1] = /usr/share/octave/packages/symbolic-2.9.0+
[1,2] = /usr
}
installed_pkgs_dirs =
{
[1,1] = /usr/share/octave/packages/symbolic-2.9.0+
[1,2] = /usr
}
installed_pkgs_dirs =
{
[1,1] = /usr
[1,2] = /usr/share/octave/packages/symbolic-2.9.0+
}
Here /usr is causing pkg test to look for m-file in /usr, which is why tests outside of symbolic run.
After some debugging, it appears m-file https://hg.savannah.gnu.org/hgweb/octave/file/04120d65778a/scripts/pkg/private/expand_rel_paths.m is causing the problem.
This part of the code
if (strncmpi (pkg_list{i}.dir, "__OH__", 6))
pkg_list{i}.dir = [ loc pkg_list{i}.dir(7:end) ];
pkg_list{i}.archprefix = [ loc pkg_list{i}.archprefix(7:end) ];
endif
never checks if "__OH__" is a prefix of pkg_list{i}.archprefix. It simply assumes so. In our case, pkg_list{i}.archprefix is empty, causing loc (which is /usr) to be prepended to the empty path.
nice work! Can you file that upstream and link the issue number here? I guess we'll not be porting our makefile to pkg test quite yet.
Sure, the upstream bug is https://savannah.gnu.org/bugs/index.php?62681
------- Original Message ------- On Friday, July 8th, 2022 at 11:06 AM, Markus Mützel @.***> wrote:
Update of bug #62681 (project octave):
Item Group: None => Unexpected Error or
Warning Status: Confirmed => Ready For Test
Follow-up Comment #15:
I pushed this change to create the
prefixandarch_prefixdirectories independently from the build rules of the package that is about to be installed: https://hg.savannah.gnu.org/hgweb/octave/rev/65c4d98352d3
That should be fixing the underlying issue that we figured out with your help. (Much appreciate it.)
Additionally, I pushed a slightly different patch from the change you proposed in comment #1 here: https://hg.savannah.gnu.org/hgweb/octave/rev/cf5f46b2e052
That should also work correctly if "OH" happens to be an actual part of the path of those prefixes (and is not the replacement prefix).
Marking as ready for test.
Reply to this item at:
https://savannah.gnu.org/bugs/?62681
Message sent via Savannah https://savannah.gnu.org/
Upstream bug https://savannah.gnu.org/bugs/index.php?62681 fixed:
------- Original Message ------- On Tuesday, July 19th, 2022 at 7:18 AM, Markus Mützel @.***> wrote:
Update of bug #62681 (project octave):
Status: Ready For Test => Fixed
Open/Closed: Open => Closed
Follow-up Comment #19:
Thanks for testing again.
Closing as fixed.
Reply to this item at:
https://savannah.gnu.org/bugs/?62681
Message sent via Savannah https://savannah.gnu.org/
Fixed in 3070c07f79ff749158a3f3e239c467ddffec7787