Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Wikipedia: Wikitech

Adding a table in a test class

 

 

Wikipedia wikitech RSS feed   Index | Next | Previous | View Threaded


jeroendedauw at gmail

May 25, 2012, 2:47 PM

Post #1 of 3 (163 views)
Permalink
Adding a table in a test class

Hey,

I have some test class in which I need to (temporary) add a table. I did
some stuff that works locally for my (just constructing some SQL and
passing it to wfGetDb()->safeQuery) but it fails on Jenkins, presumably
because it's using SQLLite or whatever there. Is there a better way to add
such tables?

Cheers

--
Jeroen De Dauw
http://www.bn2vs.com
Don't panic. Don't be evil.
--
_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


cmcmahon at wikimedia

May 25, 2012, 3:12 PM

Post #2 of 3 (159 views)
Permalink
Re: Adding a table in a test class [In reply to]

Use a stub instead? http://www.phpunit.de/manual/3.0/en/mock-objects.html (at
the bottom of the page)

On Fri, May 25, 2012 at 3:47 PM, Jeroen De Dauw <jeroendedauw [at] gmail>wrote:

> Hey,
>
> I have some test class in which I need to (temporary) add a table. I did
> some stuff that works locally for my (just constructing some SQL and
> passing it to wfGetDb()->safeQuery) but it fails on Jenkins, presumably
> because it's using SQLLite or whatever there. Is there a better way to add
> such tables?
>
> Cheers
>
> --
> Jeroen De Dauw
> http://www.bn2vs.com
> Don't panic. Don't be evil.
> --
> _______________________________________________
> Wikitech-l mailing list
> Wikitech-l [at] lists
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>
_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Platonides at gmail

May 25, 2012, 4:03 PM

Post #3 of 3 (164 views)
Permalink
Re: Adding a table in a test class [In reply to]

On 25/05/12 23:47, Jeroen De Dauw wrote:
> Hey,
>
> I have some test class in which I need to (temporary) add a table. I did
> some stuff that works locally for my (just constructing some SQL and
> passing it to wfGetDb()->safeQuery) but it fails on Jenkins, presumably
> because it's using SQLLite or whatever there. Is there a better way to add
> such tables?
>
> Cheers

What's the definition of your table?
It should be possible to write it in a way compatible with both MySQL
and SQLite. Problem: We support more backends.
Another option is to branch depending on the backend used.

And finally, there's the option to skip that test iif the backend is
SQLite (there's currently a test doing that on mysql, take a look at it).

Cheers


_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Wikipedia wikitech RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.