karlmdavis / rps-tourney

An online multi-player Rock-Paper-Scissors game. Just because.
https://rpstourney.com/
1 stars 2 forks source link

Stop using src/main/webapp resources in EmbeddedServer in ITs #36

Open karlmdavis opened 10 years ago

karlmdavis commented 10 years ago

As documented in Issue #35, EmbeddedServer is handling src/main/webapp resources incorrectly. Worse still, there really isn't any way that those resources can be handled correctly, besides using the fully packaged WAR.

Two options:

  1. Only use the packaged WAR in any ITs that use EmbeddedServer.
  2. Switch out the src/main/webapp usage for target/test-classes/webapp-test, instead (which doesn't currently exist).
karlmdavis commented 8 years ago

So here's the deal:

As part of this task, then, I'm going to go through and rip out all usage of EmbeddedServer and its like in tests. (It's still possibly useful for Docker-type deployment scenarios.)

karlmdavis commented 6 years ago

So this was in-progress when I went back and picked up this project again a few days ago. After thinking about it for a while, here are my thoughts:

  1. Switching to ITs that run against a WAR means that using DI in the ITs gets really tricky:
    • Barring some complicated-ass remoting fuckery, the IT test code will be running in a different JVM than the app under test.
    • With HSQL, getting access to the app's DB is tricky (it can be done, though, as I did it with bluebutton-data-server by running HSQL's server mode).
  2. I like the idea of being able to run at least some of the ITs against production.
    • This presents challenges, though, around test accounts and such. With this app in particular, I wouldn't want test accounts showing up on leaderboards or anything like that.
  3. There's probably still a need for some ITs that aren't safe to run against production. I could see tagging the ITs to indicate which are which.
  4. The -webapp project already doesn't use EmbeddedServer.
  5. The -service-app project does use EmbeddedServer, but doesn't currently have any webapp resources.

So. Conclusions: