View more context

 

Mo

Removing number_format from DBCurrency would be great, basically I have had to work around the facy that DBCurrency is not great in most of my code!

Mo

Anyone know why travis is returning No database selected here: https://travis-ci.org/silvercommerce/orders-admin/jobs/582787402

blueo

Recently had something similar but changed to dist: trusty admittedly just as a copy from a working config so I can't say why it worked... but it did uI recently had to change some configs to dist: trusty as it seems the default has become dist: xenial.

Scopey

SS installer's travis config has recently been overhauled if you want a reference: https://github.com/silverstripe/silverstripe-installer/blob/4/.travis.yml

Show 1 attachment(s)
GitHub  
silverstripe/silverstripe-installer

The installer for SilverStripe CMS and Framework. Check out this repository to start working with SilverStripe! - silverstripe/silverstripe-installer

Hide attachment content
nightjarnz

FTR, dist: xenial comes with services stripped out that were included by default in trusty. Read about this here: https://blog.travis-ci.com/2019-04-15-xenial-default-build-environment :)

Show 1 attachment(s)
blog.travis-ci.com  
Ubuntu Xenial 16.04 as the default Travis CI build environment

Xenial as the default Travis CI build environment is coming up next week, starting incrementally on Tuesday April 23rd, 2019. Since Ubuntu 14.04 reaches End of Life on April 30th, 2019, we’ll be g...

Hide attachment content
👍 (1)
Mo

@Scopey I did notice that framework uses dist: trusty

Mo

I have required Mysql/Postgres services. Will try switching to trusty in the morning.

nightjarnz

@Mo xenial should work, you just have to also define

  1. services:
  2. - postgresql

iirc

nightjarnz

There may be more though, depending on what you're doing. You can read a good write up from evaluation on this at https://github.com/silverstripe/silverstripe-framework/issues/9144

Show 1 attachment(s)
GitHub  
TravisCI upgrade to Xenial · Issue #9144 · silverstripe/silverstripe-framework

Description TravisCI switches to Ubuntu Xenial 16.04 as the default Travis CI build environment. That means CI setups on all our repositories without explicit dist and that are not dist: xenial may...

Hide attachment content
nightjarnz

for now dist: trusty sure is the easy way out though ;p

(1)
Mo

@nightjarnz services is already defined in the config file I shared?

Mo

Just tried it with dist: trusty (and some other settings copied from framework)

Mo

do I need to provide environmental variables now or something...

robbieaverill

another thing is that if your test class doesn't have a fixture file, or doesn't define protected $usesDatabase = true and you try and do anything with a DB e.g. $page->write() then it will throw that error too

Mo

Wouldn't $useDatabase throw an error on my local environment as well?

Mo

But fail with the No database error when run on travis 😕

robbieaverill

not necessarily, you have a .env file locally right? there isn't one in travis runs - it populates a few specific env vars for travis instead

Mo

Right, I will have a look though the code and see if there is anything obvious

nightjarnz

Without an indication to set up a test database, your tests are probably running on your "production" (local env) database.

Mo

but they might be using the connection details from .env

Mo

I guess if I remove my .env locally, I can see if that causes things to fail


Show less replies
Mo

I am using the same config here and it works fine 😕

robbieaverill

not all repos have been migrated to xenial yet, so some may still use trusty as the default when you don't specify one

jakx

https://slackarchive.silverstripe.org/slack-archive/message/265283#msg_265283 @Mo did you ever get to the bottom of this?

i.e

  1. Fatal error: Uncaught Error: Call to a member function activate() on boolean in /path/to/project/vendor/silverstripe/framework/src/Dev/State/KernelTestState.php on line 91

I'm having the same issue at the moment

Show 3 attachment(s)
slackarchive.silverstripe.org  
Slack Archive - Message by Mo | SilverStripe Users Slackarchive

Fatal error: Uncaught Error: Call to a member function activate() on boolean in /path/to/project/vendor/silverstripe/framework/src/Dev/State/KernelTestState.php on line 91

slackarchive.silverstripe.org  
Slack Archive - Message by Mo | SilverStripe Users Slackarchive

Fatal error: Uncaught Error: Call to a member function activate() on boolean in /path/to/project/vendor/silverstripe/framework/src/Dev/State/KernelTestState.php on line 91

slackarchive.silverstripe.org  
Slack Archive - Message by Mo | SilverStripe Users Slackarchive

Fatal error: Uncaught Error: Call to a member function activate() on boolean in /path/to/project/vendor/silverstripe/framework/src/Dev/State/KernelTestState.php on line 91

Hide attachment content
jakx

Seems to have been resolved, I suspect it was something local to the test that was running at the time that the error was triggered

Mo

@jakx I think I might have just restarted the computer for that one...

👍 (1)