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

Added Spock framework and some tests, both old and new #332

Closed
wants to merge 8 commits into
base: trunk
from

Conversation

Projects
None yet
4 participants
@ham1
Copy link

ham1 commented Nov 19, 2017

Description

WIP for adding Spock to JMeter. Created some new tests and translated some old ones.

Motivation and Context

See the Mocking Framework email thread: http://mail-archives.apache.org/mod_mbox/jmeter-dev/201612.mbox/%3c36ce3782-dee8-388c-9539-5bcfb8d5f39a@internetallee.de%3e

How Has This Been Tested?

By running the unit tests ;)

Screenshots (if appropriate):

Types of changes

  • Dev enhancement

Checklist:

  • My code follows the code style of this project.
  • I have updated the documentation accordingly.

@ham1 ham1 force-pushed the ham1:spock branch from 86cd98e to 5cacd14 Nov 19, 2017

@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Nov 19, 2017

Codecov Report

Merging #332 into trunk will increase coverage by 0.17%.
The diff coverage is 78.96%.

Impacted file tree graph

@@             Coverage Diff             @@
##             trunk     #332      +/-   ##
===========================================
+ Coverage     57.9%   58.08%   +0.17%     
- Complexity   10023    10100      +77     
===========================================
  Files         1148     1155       +7     
  Lines        73798    73897      +99     
  Branches      7331     7339       +8     
===========================================
+ Hits         42732    42921     +189     
+ Misses       28587    28496      -91     
- Partials      2479     2480       +1
Impacted Files Coverage Δ Complexity Δ
...ache/jmeter/report/processor/ApdexSummaryData.java 68.42% <ø> (+68.42%) 8 <0> (+8) ⬆️
...apache/jmeter/report/processor/ListResultData.java 75% <ø> (+75%) 5 <0> (+5) ⬆️
...e/jmeter/report/processor/ApdexThresholdsInfo.java 100% <ø> (+100%) 5 <0> (+5) ⬆️
...apache/jmeter/timers/UniformRandomTimerSpec.groovy 100% <100%> (ø) 3 <3> (?)
...meter/protocol/jdbc/sampler/JDBCSamplerSpec.groovy 100% <100%> (ø) 6 <6> (?)
...che/jmeter/protocol/http/util/HTTPUtilsSpec.groovy 100% <100%> (ø) 6 <6> (?)
.../report/processor/Top5ErrorsSummaryDataSpec.groovy 100% <100%> (ø) 5 <5> (?)
.../jmeter/report/processor/ListResultDataSpec.groovy 100% <100%> (ø) 1 <1> (?)
...t/processor/Top5ErrorsBySamplerConsumerSpec.groovy 100% <100%> (ø) 4 <4> (?)
...r/report/processor/ApdexSummaryConsumerSpec.groovy 100% <100%> (ø) 1 <1> (?)
... and 28 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 85a9f13...9d1ff3b. Read the comment docs.

@pmouawad

This comment has been minimized.

Copy link
Contributor

pmouawad commented Nov 21, 2017

Hi @ham1 ,
Thanks for this interesting PR.
There is a conflict in it, could you rebase it as you proposed.
Also, there is something I don't understand, I see coverage has decreased while you modified some existing tests and added new ones.
Maybe as a first step, you could only add new tests and not impact existing ones ?

Thank you
Regards

@ham1 ham1 force-pushed the ham1:spock branch 9 times, most recently from 2d2b127 to 0e83e55 Nov 21, 2017

@ham1

This comment has been minimized.

Copy link

ham1 commented Nov 23, 2017

I've fixed any conflicts now.

So far I've kept the migrations of, and added to:

  • RunTime
  • HTTPUtils

I've added new tests for:

  • UniformRandomTimer
  • JDBCSampler - however I can't see how to test sample() due to use of the inner class DataSourceComponenetImpl used in DataSourceElement.getConnection()
  • Top5ErrorsBySamplerData and found a bug and fixed it here and #337
  • Top5ErrorsBySamplerConsumer with some refactoring

Codecov edits its original comment, coverage is marginally up.

I will try to add some more tests over the next few days if this is useful?

Also, I don't know much about ant and the way JMeter manages dependencies, so please let me know if there's a better way.

@ham1 ham1 force-pushed the ham1:spock branch from 5499ee7 to 4cad74f Nov 23, 2017

@ham1

This comment has been minimized.

Copy link

ham1 commented Nov 23, 2017

I've added some more tests:

  • ApdexSummaryConsumer and
  • ListResultData

Plus some code tidy up.

Any thoughts?

@pmouawad

This comment has been minimized.

Copy link
Contributor

pmouawad commented Nov 23, 2017

Thanks @ham1 ,
I will have some time next week to merge it or this week-end.
If anybody wants to do that before he's welcome.
Thanks

@ham1

This comment has been minimized.

Copy link

ham1 commented Nov 23, 2017

Great, thank you. If someone could merge #337 first then I can make there are no conflicts.

@ham1 ham1 force-pushed the ham1:spock branch from 9d1ff3b to 2bac13f Nov 24, 2017

asfgit pushed a commit that referenced this pull request Nov 25, 2017

Add spock framework for groovy unit tests.
This is part of pr #332 from github.
Contributed by Graham Russell


git-svn-id: https://svn.apache.org/repos/asf/jmeter/trunk@1816319 13f79535-47bb-0310-9956-ffa450edef68

asfgit pushed a commit that referenced this pull request Nov 25, 2017

Add first spock tests.
Part of pr #332 from github
Contributed by Graham Russell


git-svn-id: https://svn.apache.org/repos/asf/jmeter/trunk@1816321 13f79535-47bb-0310-9956-ffa450edef68

asfgit pushed a commit that referenced this pull request Nov 25, 2017

Convert unit tests fpr HTTPUtils to use spock framework.
Part of pr #332 from github.
Contributed by Graham Russell


git-svn-id: https://svn.apache.org/repos/asf/jmeter/trunk@1816322 13f79535-47bb-0310-9956-ffa450edef68

asfgit pushed a commit that referenced this pull request Nov 25, 2017

More unit tests from pr #332 from github
Contributed by Graham Russell


git-svn-id: https://svn.apache.org/repos/asf/jmeter/trunk@1816323 13f79535-47bb-0310-9956-ffa450edef68

asfgit pushed a commit that referenced this pull request Nov 25, 2017

Minor changes in the code without functional change and a bit of form…
…atting.

Part of pr #332 from github
Contributed by Graham Russell


git-svn-id: https://svn.apache.org/repos/asf/jmeter/trunk@1816326 13f79535-47bb-0310-9956-ffa450edef68

asfgit pushed a commit that referenced this pull request Nov 25, 2017

Add tests for ListResultData
Part of #332 from github
Contributed by Graham Russell


git-svn-id: https://svn.apache.org/repos/asf/jmeter/trunk@1816327 13f79535-47bb-0310-9956-ffa450edef68

asfgit pushed a commit that referenced this pull request Nov 25, 2017

asfgit pushed a commit that referenced this pull request Nov 25, 2017

Reorder the methods of the class and remove useless javadoc. Part of #…
…332 Contributed by Graham Russell

git-svn-id: https://svn.apache.org/repos/asf/jmeter/trunk@1816331 13f79535-47bb-0310-9956-ffa450edef68

asfgit pushed a commit that referenced this pull request Nov 25, 2017

@asfgit asfgit closed this in 3625487 Nov 25, 2017

@FSchumacher

This comment has been minimized.

Copy link
Contributor

FSchumacher commented Nov 25, 2017

Thanks for your contribution.

@ham1 ham1 deleted the ham1:spock branch Nov 25, 2017

@ham1

This comment has been minimized.

Copy link

ham1 commented Nov 25, 2017

Thank you for merging!

asfgit pushed a commit that referenced this pull request Dec 22, 2017

The name of the jar file is spock-core and not spock.
Follow-up to r1816319 and relates to #332 on github.


git-svn-id: https://svn.apache.org/repos/asf/jmeter/trunk@1819017 13f79535-47bb-0310-9956-ffa450edef68

asfgit pushed a commit that referenced this pull request Dec 22, 2017

Now that we renamed spock to spock-core for eclipse, we had to do it
for maven, ant and the tests, too.

Follow-up to r1819017 which was a follow-up to r1816319.
Relates to #332 on github


git-svn-id: https://svn.apache.org/repos/asf/jmeter/trunk@1819021 13f79535-47bb-0310-9956-ffa450edef68
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment