juju test suite should use juju-mongodb

Bug #1301353 reported by John A Meinel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
juju-core
Fix Released
Low
John A Meinel
1.18
Fix Released
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)
Changed in juju-core:
assignee: nobody → Jesse Meek (waigani)
milestone: none → 2.0
status: Triaged → In Progress
Jesse Meek (waigani)
Changed in juju-core:
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 2.0 → 1.19.0
Curtis Hovey (sinzui)
Changed in juju-core:
status: Fix Committed → Fix Released
Revision history for this message
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
Revision history for this message
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)
Changed in juju-core:
assignee: nobody → John A Meinel (jameinel)
milestone: none → 1.19.2
status: Triaged → In Progress
Go Bot (go-bot)
Changed in juju-core:
status: In Progress → Fix Committed
Changed in juju-core:
status: Fix Committed → Fix Released
Revision history for this message
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)
Changed in juju-core:
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
Changed in juju-core:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.