Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add integration tests #20

Closed
felixbarny opened this issue Mar 20, 2018 · 4 comments · Fixed by #57
Closed

Add integration tests #20

felixbarny opened this issue Mar 20, 2018 · 4 comments · Fixed by #57
Assignees

Comments

@felixbarny
Copy link
Member

felixbarny commented Mar 20, 2018

Consider using https://www.testcontainers.org.

@felixbarny felixbarny modified the milestones: Alpha, Beta Mar 20, 2018
@bsideup
Copy link

bsideup commented Mar 25, 2018

Hi @felixbarny!

Testcontainers' member is here :) I'm happy to answer questions if you have any to make it happen :)

The main reason why I joined Testcontainers projects because we (ZeroTurnaround back then) wanted to test our APMs and Java Agents and it was painful without Docker given the complexity of setup, it seems that your motivation is quite the same :)

You can check one of my sample projects:
https://github.com/bsideup/javaagent-boilerplate/tree/master/src

P.S. If you happen to be in Berlin, you can let me know (short notice is ok) if you want to have coffee / beers and talk about TC and APMs in general :)

@felixbarny
Copy link
Member Author

seems that you motivation is quite the same :)

yes, indeed :D

Thanks for offering your help, I'll get back to it! I think I stumbled upon your repo some time ago, didn't realize the testcontainers stuff in it though :D

I live in Munich, but when I'm in Berlin, I'll let you know 🍻

Are you usually adding the integration tests into the same repo or do you create a separate one for it?

@bsideup
Copy link

bsideup commented Mar 25, 2018

@felixbarny that example is heavily inspired by what we did at ZeroTurnaround and contains some abstractions to make it even simpler to write tests, I didn't realize that it actually hides the Testcontainers usage :D

I would recommend to keep tests next to the project, since they are actually quite fast and help to do test-driven development by testing your change even before committing it. This is also how we did it in Zipkin when I helped them

@felixbarny
Copy link
Member Author

This issue is just about having a simple proof of concept integration test which deploys a war to a tomcat server and reports transactions to a mock apm server (in contrast to #55). The transactions can then be verified using plain AssertJ assertions. Also, the application deployed on tomcat should be easily debuggable.

Going forward, these type of integration tests will verify the agent's correct behavior across different application servers, frameworks, JVM vendors and different versions of these. This can become quite a complex build matrix, which could be managed either by Jenkins or just using parameterized JUnit tests, which use version parameters, for example to test different tomcat versions.

It also probably makes sense to not execute the integration tests by default but only when a special maven profile is set. That way, it's possible to only execute the unit tests without the potentially slower integration tests (testcontainers is quite fast though).

felixbarny added a commit to felixbarny/apm-agent-java that referenced this issue Apr 12, 2018
closes elastic#20

Signed-off-by: Felix Barnsteiner <felix.barnsteiner@elastic.co>
felixbarny added a commit to felixbarny/apm-agent-java that referenced this issue Apr 25, 2018
closes elastic#20

Signed-off-by: Felix Barnsteiner <felix.barnsteiner@elastic.co>
felixbarny added a commit that referenced this issue Apr 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants