[MacPorts] #56016: make test uses the installed version of MacPorts, not the just-built one

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[MacPorts] #56016: make test uses the installed version of MacPorts, not the just-built one

MacPorts
#56016: make test uses the installed version of MacPorts, not the just-built one
------------------------+--------------------
 Reporter:  ryandesign  |      Owner:
     Type:  defect      |     Status:  new
 Priority:  Normal      |  Milestone:
Component:  base        |    Version:  2.4.99
 Keywords:              |       Port:
------------------------+--------------------
 `make test` uses some combination of the already installed MacPorts and
 the just-built one. This can cause tests to fail if the installed version
 doesn't have the same capabilities as the built version.

 For example, when I had MacPorts 2.4.2 installed, and then cloned master
 and ran `./configure` and `make` and `make test` (without running `sudo
 make install`), the "Sed in place" test failed, saying it `can't read
 "portutil::autoconf::sed_ext_flag": no such variable`.
 `portutil::autoconf::sed_ext_flag` was removed in
 [209e78f57a3886d1091948c17948fcd4928c855c/macports-base] and no remnant of
 it remains in master, so it must have gotten that from the installed copy
 of MacPorts 2.4.2.

 {{{
 ==== reinplace Reinplace  unit test. "Sed in place" functionality. FAILED
 ==== Contents of test case:

     reinplace s/Macports/MacPorts/1 $file
     catch {set f [open $file r]}
     set cont [read -nonewline $f]
     if { $cont != "MacPorts reinplace unit test?" } {
         return "FAIL: reinplace no args."
     }
     close $f

     reinplace -E s/test?/testing/1 $file
     catch {set f [open $file r]}
     set cont [read -nonewline $f]
     if { $cont != "MacPorts reinplace unit testing?" } {
         return "FAIL: reinplace (-E) extended regex."
     }
     close $f

     reinplace -W $second s/Macports/MP/1 file
     catch {set f [open $second/file r]}
     set cont [read -nonewline $f]
     if { $cont != "MP reinplace unit test?" } {
         return "FAIL: reinplace (-W) relative path."
     }
     close $f

     reinplace -n s/unit/testing/1 $file
     catch {set f [open $file r]}
     set cont [read -nonewline $f]
     if { $cont != "" } {
         return "FAIL: reinplace (-n) suppress output."
     }
     close $f

     return "Reinplace successful."


 ---- Test generated error; Return code was: 1
 ---- Return code should have been one of: 0 2
 ---- errorInfo: can't read "portutil::autoconf::sed_ext_flag": no such
 variable
     while executing
 "if {$portutil::autoconf::sed_ext_flag eq "N/A"} {
                 ui_debug "sed extended regexp not available"
                 return -code error "rei..."
     (procedure "reinplace" line 80)
     invoked from within
 "reinplace -E s/test?/testing/1 $file"
     ("uplevel" body line 10)
     invoked from within
 "uplevel 1 $script"
 ---- errorCode: NONE
 ==== reinplace FAILED
 }}}

--
Ticket URL: <https://trac.macports.org/ticket/56016>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #56016: make test uses the installed version of MacPorts, not the just-built one

MacPorts
#56016: make test uses the installed version of MacPorts, not the just-built one
-------------------------+--------------------
  Reporter:  ryandesign  |      Owner:
      Type:  defect      |     Status:  new
  Priority:  Normal      |  Milestone:
 Component:  base        |    Version:  2.4.99
Resolution:              |   Keywords:
      Port:              |
-------------------------+--------------------

Comment (by neverpanic):

 Yes, I'm well aware of that. Unfortunately it's hard to test a non-
 installed version of MacPorts. I have not yet found a good solution.

--
Ticket URL: <https://trac.macports.org/ticket/56016#comment:1>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #56016: make test uses the installed version of MacPorts, not the just-built one

MacPorts
In reply to this post by MacPorts
#56016: make test uses the installed version of MacPorts, not the just-built one
-------------------------+--------------------
  Reporter:  ryandesign  |      Owner:
      Type:  defect      |     Status:  new
  Priority:  Normal      |  Milestone:
 Component:  base        |    Version:  2.4.99
Resolution:              |   Keywords:
      Port:              |
-------------------------+--------------------

Comment (by ryandesign):

 I figured we knew about it since the buildbot installs before testing.

 Is there a way we could check in `make test` if `make install` has been
 run, and if not, error out an tell the user to install? Would be better
 than failing in weird ways.

--
Ticket URL: <https://trac.macports.org/ticket/56016#comment:2>
MacPorts <https://www.macports.org/>
Ports system for macOS