juju test suite should use juju-mongodb

Bug #1301353 reported by John A Meinel on 2014-04-02
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
juju-core
Low
John A Meinel
1.18
Low
John A Meinel

Bug Description

When using juju on trusty we now use juju-mongodb to provide "mongod". However, for testing purposes we still require "mongod" to be on the PATH and we give ugly panics when it isn't available.

installing 'mongodb-server' works around the issue for now, but the test suite should be able to use our preferred mongo on trusty.

Related branches

Jesse Meek (waigani) on 2014-04-08
Changed in juju-core:
assignee: nobody → Jesse Meek (waigani)
milestone: none → 2.0
status: Triaged → In Progress
Jesse Meek (waigani) on 2014-04-10
Changed in juju-core:
status: In Progress → Fix Committed
Curtis Hovey (sinzui) on 2014-04-11
Changed in juju-core:
milestone: 2.0 → 1.19.0
Curtis Hovey (sinzui) on 2014-04-15
Changed in juju-core:
status: Fix Committed → Fix Released
John A Meinel (jameinel) wrote :

The fix from Jesse was not actually related to *this* bug. This bug is the fact that if you are on Trusty and have "juju-mongodb" installed (say via juju-local), the test suite still fails because it is looking for "mongod" to be in $PATH.
We shouldn't have to add a symlink for the test suite to run (or install mongodb-server). Instead, it should use /usr/lib/juju/bin/mongod if it cannot find mongod in $PATH.

I still want to prefer mongod in $PATH because the charm store tests need the v8 engine that is not available in juju-mongodb.

Changed in juju-core:
assignee: Jesse Meek (waigani) → nobody
milestone: 1.19.0 → none
status: Fix Released → Triaged
John A Meinel (jameinel) wrote :

The fix might be as simple as:
=== modified file 'testing/mgo.go'
--- testing/mgo.go 2014-04-17 00:19:01 +0000
+++ testing/mgo.go 2014-05-08 15:47:55 +0000
@@ -142,7 +142,12 @@
  if inst.Params != nil {
   mgoargs = append(mgoargs, inst.Params...)
  }
- server := exec.Command("mongod", mgoargs...)
+ path, err := exec.LookPath("mongod")
+ if err != nil {
+ // No mongod on path
+ path, err = exec.LookPath("/usr/lib/juju/bin/mongod")
+ }
+ server := exec.Command(path, mgoargs...)
  out, err := server.StdoutPipe()
  if err != nil {
   return err

But I haven't tested it.

John A Meinel (jameinel) on 2014-05-09
Changed in juju-core:
assignee: nobody → John A Meinel (jameinel)
milestone: none → 1.19.2
status: Triaged → In Progress
Go Bot (go-bot) on 2014-05-09
Changed in juju-core:
status: In Progress → Fix Committed
Changed in juju-core:
status: Fix Committed → Fix Released
John A Meinel (jameinel) wrote :

The fix from the 1.18 branch accidentally got reverted when landing into trunk, so it needs to be restored.

Changed in juju-core:
milestone: 1.19.2 → 1.19.3
status: Fix Released → In Progress
Go Bot (go-bot) on 2014-05-12
Changed in juju-core:
status: In Progress → Fix Committed
Curtis Hovey (sinzui) on 2014-05-30
Changed in juju-core:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers