testing a TG app

26 views
Skip to first unread message

NiL

unread,
Jul 6, 2011, 9:00:29 AM7/6/11
to turbo...@googlegroups.com
hi all
I'm working on testing my app at the moment both testing the migration path (sqla migrate) and selenium clicking bot

one trouble I ran into is I can't run my functionnal tests against a postgres DB
the render of the data for a simple GET , generates a transaction BEGIN / SELECT .....
and no COMMIT, so the drop_all of the tear_down method  waits forever for the lock to be released (IDLE in Transaction)

For the migration path, I now only the the models part (nosetests -e functional) against a DB that's been restored and migrated externally (jenkins prepares the DB), so far it's ok, but any feedback regarding the functionnal tests would be welcome.

My TG apps run concurrently with other service in production, so I introduced the use of selenium to check if everything works as expected.
Again jenkins lauches those tests
The firefow is launched in a xfvb on the CI server

What I'd like to achieve here
- get a screenshot if a test fails (I tried something with zope.events in the TestClasses, but to no success yet)
- establish test independence ( for now I consider a bulk restore of the DB between each test)

has anyone the same concerns at the moment ?

regards
NIL

NiL

unread,
Jul 26, 2011, 1:35:34 PM7/26/11
to turbo...@googlegroups.com
up, the first part stops me from testing on postgres, anyone ?

Michael Pedersen

unread,
Aug 8, 2011, 8:57:31 PM8/8/11
to turbo...@googlegroups.com
Hi Nil, I'm sorry for taking so long. I've finally been getting back into the swing of things after the hell that has been work for the past while.

Which version of TG are you using? I was running tests in a similar situation using TG2.1b2 (yes, this is old data), but didn't experience the same problems. Unfortunately, I no longer have access to that code, being that it came from my prior workplace.

Still, I have to make sure you're on 2.1 by now. Any other details you can send out?

On Tue, Jul 26, 2011 at 1:35 PM, NiL <nicolas....@gmail.com> wrote:
up, the first part stops me from testing on postgres, anyone ?

--
You received this message because you are subscribed to the Google Groups "TurboGears" group.
To view this discussion on the web visit https://groups.google.com/d/msg/turbogears/-/9dul2Fa3q7wJ.

To post to this group, send email to turbo...@googlegroups.com.
To unsubscribe from this group, send email to turbogears+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/turbogears?hl=en.



--
Michael J. Pedersen
My IM IDs: Jabber/pede...@icelus.tzo.com, AIM/pedermj022171
          Yahoo/pedermj2002, MSN/pederm...@hotmail.com
My LinkedIn Profile: http://www.linkedin.com/in/michaeljpedersen
Twitter: pedersentg

NiL

unread,
Aug 9, 2011, 3:26:23 AM8/9/11
to turbo...@googlegroups.com
yes, I fount out what was happening

If, in a functional test, you use an object like this (elixir syntax)

        group = Group.get_by(group_name='humans')

and then make your tests

when you leave the method the transaction isn't closed in PG
Even a getter only must with followed by a Session.commit()


Reply all
Reply to author
Forward
0 new messages