Jump to:

3433 Posts in 1058 Topics by 734 members

Data Model Questions

SilverStripe Forums » Data Model Questions » Unit Tests and Model Building

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 362 Views
  • mikelbring
    Avatar
    Community Member
    2 Posts

    Unit Tests and Model Building Link to this post

    I renamed a model file and do a `/dev/build/?flush=all` and it works fine for the live site, however my unit tests still want to load the old model file, although I am not using this model anywhere on the live site or in my unit tests. Do I need to run a separate build for unit tests? I cannot find anything regarding this.

  • Willr
    Avatar
    Forum Moderator
    5490 Posts

    Re: Unit Tests and Model Building Link to this post

    Are you running the tests via cli? If so then you need to also flush that. SilverStripe mantains 2 caches, a web cache and a cli one. So you if you a flush=all in a webbrowser it doesn't clear the cli version.

    Via sake you can do sake dev/tests/all flush=all

  • mikelbring
    Avatar
    Community Member
    2 Posts

    Re: Unit Tests and Model Building Link to this post

    I am actually running the tests in my browser, so is there a flush that I need to do for the tests via the browser besides `/dev/build/?flush=all` ?

  • Willr
    Avatar
    Forum Moderator
    5490 Posts

    Re: Unit Tests and Model Building Link to this post

    You could try the ?flush with your test runner - dev/tests/all?flush=all. If that doesn't work I'd double check you aren't referencing that code anywhere. What's the error message?

    362 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.