question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Duplicated smoke tests

See original GitHub issue

Credit

Credit goes to @eyalkoren for the discovery of this issue

Overview

It appears that certain tests are duplicated across sets of smoke tests. For example, take the greetingShouldReturnDefaultMessage test. This test is located in the integrations/test directory, and can be seen here.

If one examines a test run by opening a run and going to the Blue Ocean page, they can see that the same test appears to have run as a part of both the Smoke Tests 01 group and the Smoke Tests 02 group.

Details

Tests are segmented through the use of simple bash scripts. The scripts which provide this segmentation are below:

Smoke Tests 01 Smoke Tests 02(https://github.com/elastic/apm-agent-java/blob/master/scripts/jenkins/smoketests-02.sh)

Each script contains a preparatory step to generate the modules to be tested. Below is the output of each:

smoketest01

find apm-agent-plugins -maxdepth 1 -mindepth 1 -type d|grep -v "target"

apm-agent-plugins/apm-mongoclient-plugin
apm-agent-plugins/apm-redis-plugin
apm-agent-plugins/apm-spring-webmvc-plugin
apm-agent-plugins/apm-quartz-job-plugin
apm-agent-plugins/apm-jaxrs-plugin
apm-agent-plugins/apm-jsf-plugin
apm-agent-plugins/apm-httpclient-core
apm-agent-plugins/apm-kafka-plugin
apm-agent-plugins/apm-java-concurrent-plugin
apm-agent-plugins/apm-jdbc-plugin
apm-agent-plugins/apm-jmx-plugin
apm-agent-plugins/apm-servlet-plugin
apm-agent-plugins/apm-es-restclient-plugin
apm-agent-plugins/apm-opentracing-plugin
apm-agent-plugins/apm-scheduled-annotation-plugin
apm-agent-plugins/apm-mule4-plugin
apm-agent-plugins/apm-jaxws-plugin
apm-agent-plugins/apm-api-plugin
apm-agent-plugins/apm-jms-plugin
apm-agent-plugins/apm-slf4j-plugin
apm-agent-plugins/apm-process-plugin
apm-agent-plugins/apm-urlconnection-plugin
apm-agent-plugins/apm-okhttp-plugin
apm-agent-plugins/apm-apache-httpclient-plugin
apm-agent-plugins/apm-asynchttpclient-plugin
apm-agent-plugins/apm-error-logging-plugin
apm-agent-plugins/apm-hibernate-search-plugin
apm-agent-plugins/apm-spring-resttemplate-plugin

smoketest02

find integration-tests -maxdepth 1 -mindepth 1 -type d|grep -v "target"|

integration-tests/soap-test
integration-tests/cdi-app
integration-tests/spring-boot-2
integration-tests/application-server-integration-tests
integration-tests/spring-boot-1-5
integration-tests/jsf-app
integration-tests/simple-webapp

Reasoning

It appears as though the preparatory step correctly separates the two sets of tests but that Maven may be running the same test(s) in each instance. Maven is executed with the following parameters:

./mvnw -q -Dmaven.javadoc.skip=true -am -amd -pl ${MOD} -P integration-test-only verify (where $MOD is the set of modules from each prepatory step.)

Could, perhaps, the -am or the -amd flag inadvertently be triggering a larger set of tests? Or, is something in one each tests linking to the other set through a dependency of some kind?

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:19 (19 by maintainers)

github_iconTop GitHub Comments

1reaction
cachedoutcommented, Feb 17, 2020

Let us know what we should do.

I think that broadly speaking, the steps are going to be as follows. (I’ve adopted these from poking around a bit in the hbase repo, which seems to have done this pretty well.)

  1. Find a place to store test annotations. Here are some examples from hbase.

  2. Create these annotations, corresponding to the original groups or new groups, if you like.

  3. Apply annotations to test classes using @Category. ex with pseudo-code:

import org.junit.experimental.categories.Category;
import my.path.to.annotations.SmokeTests01

@Category(SmokeTests01.class)
public class MongoClientSyncInstrumentationIT extends AbstractMongoClientInstrumentationTest {

<snip>
  1. Add groups to the <configuration> block of the Surefire plugin. Here is an arbitrary example of the needed elements:
<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-surefire-plugin</artifactId>
	<configuration>
                		<excludedGroups>my.path.to.annotations.SmokeTest01</excludedGroups>
	</configuration>
</plugin>
  1. At this point, you should be able to run tests with the -Dgroups=my.path.to.annotations.SmokeTest01 flag with Maven.

We may need to adjust course depending on what we find, but hopefully this should give you a clearer idea of how I think this should probably be done.

0reactions
cachedoutcommented, Jun 11, 2020

Oops. I didn’t mean to close this one entirely.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why are "smoke tests" called "smoke tests"? - Stack Overflow
Possible Duplicate: What is a smoke testing and what will it do for me? Why are "smoke tests" called "smoke tests"? I don ......
Read more >
Smoke tests/starting to test - Tester Work Support Centre
Smoke testing is the process of ensuring a software build is stable before ... These are considered Duplicates, as the secondary problems ...
Read more >
Is duplicated code more tolerable in unit tests – iTecNote
I ruined several unit tests some time ago when I went through and refactored them to make them more DRY–the intent of each...
Read more >
Set Up iOS Smoke Tests in Three Steps! | by Joe Susnick
This shows me duplicating “Debug” but you can duplicate your test target if you have one. Duplicate it! Name your new configuration SmokeTest...
Read more >
Smoke Testing In Flutter - FlutterDevs
Hi everyone! today we start learning about smoke testing in a flutter, Smoke tests take your code, ... Make duplicates of your documents...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found