Bug 60886

Summary: Document building and testing issues in corporate environments
Product: JMeter - Now in Github Reporter: Michael Osipov <michaelo>
Component: MainAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: enhancement CC: enricjaen, p.mouawad, volcanic.ws
Priority: P2    
Version: 3.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 60883    
Attachments: Add proxy settings to ant download tasks
Add proxy settings to ant download tasks

Description Michael Osipov 2017-03-17 20:59:07 UTC
Building and testing JMeter in a corporate environment is hard if your are locked down and have outbound access via HTTP proxy only. See bug 60883.

1. Building: build.xml requires direct, outbound access to the Internet. You can fiddle around it by applying following patch:
> diff --git a/build.xml b/build.xml
> index 4ddd4513f..08c2fdf83 100644
> --- a/build.xml
> +++ b/build.xml
> @@ -3052,7 +3052,8 @@ run JMeter unless all the JMeter jars are added.
>    <!-- Download a jar file and check its hash; if correct, move to correct directory -->
>    <target name="_get_jarfile" if="_get_jarfile" unless="file.exists">
>      <echo message="Fetching: ${path}/${jar}" level="info"/>
> -    <get src="${loc}/${jar}"
> +    <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"/>
> +       <get src="${loc}/${jar}"
>           dest="${build.dir}/${jar}"
>           usetimestamp="false" ignoreerrors="false"/>
>      <antcall target="_checkMD5">
> 
Values are in build-local.properties. Username/password for proxy can be supplied optionally.
2. Testing: several tests require hard outbound connection to 8.8.8.8 (DNS) or proxy sampler test to jmeter.apache.org. Impossible to pass tests.

Document both issues in README.md and building.html.

People should be aware that this is problematic before wasting time to figure out what's wrong.
Comment 1 Felix Schumacher 2017-03-17 21:22:58 UTC
I have added the usage of ANT_OPTS. Is the patch really needed, when that environment entry is set?

Date: Fri Mar 17 21:20:45 2017
New Revision: 1787505

URL: http://svn.apache.org/viewvc?rev=1787505&view=rev
Log:
Mention the usage of ANT_OPTS to use a proxy in the building instructions.

Bugzilla Id: 60886

Modified:
    jmeter/trunk/README.md
    jmeter/trunk/xdocs/building.xml
Comment 2 Michael Osipov 2017-03-17 21:29:04 UTC
While it looks OK, it recommends a bad practice: -Dhttp.pass=xxxxx
You expose your password to everyone running top. Very bad idea.
Comment 3 Felix Schumacher 2017-03-17 21:35:18 UTC
Created attachment 34842 [details]
Add proxy settings to ant download tasks

Add proxy settings to the download_tasks, so that the environment entries are not repeated in something like top or ps.
Comment 4 Felix Schumacher 2017-03-17 21:38:45 UTC
*** Bug 53709 has been marked as a duplicate of this bug. ***
Comment 5 Felix Schumacher 2017-03-17 21:42:03 UTC
Created attachment 34843 [details]
Add proxy settings to ant download tasks

Should stop coding for today. Now the complete patch (hopefully).
Comment 6 Michael Osipov 2017-03-18 10:26:49 UTC
(In reply to Felix Schumacher from comment #5)
> Created attachment 34843 [details]
> Add proxy settings to ant download tasks
> 
> Should stop coding for today. Now the complete patch (hopefully).

Looks good to me. I will test tomorrow and let you know.
Comment 7 Michael Osipov 2017-03-19 22:04:14 UTC
Tested the patch. Works like a chimp.

Please revert r1787505, it contains obsolete information.

The following PR contains necessary information to make tests pass w/o Internet access: https://github.com/apache/jmeter/pull/284

This is not the best solution, but it does its job now and everyone can contribute. The best solution would either be to pass proxy to the testplans or run an embedded Jetty to mimic necessary behavior. This is what we do in Maven Wagon.

Some README.md updates for the PR are necessary too.

WDYT?
Comment 8 Michael Osipov 2017-03-19 22:07:48 UTC
Command line: ant test -Dskip.bug52310=true -Dskip.bug60607=true -Dskip.batchtest_Http4ImplPreemptiveBasicAuth=true -Dskip.batchtest_SlowCharsFeature=true -Dskip.batchtest_TestKeepAlive=true -Dskip.test_http=true -Dskip.test_TestDNSCacheManager.testWithCustomResolverAnd1Server=true
Comment 9 Felix Schumacher 2017-03-23 20:57:23 UTC
Date: Thu Mar 23 20:44:50 2017
New Revision: 1788319

URL: http://svn.apache.org/viewvc?rev=1788319&view=rev
Log:
Build improvements to better enable builds in environments that are behind a proxy.

Bugzilla Id: 60886

Modified:
    jmeter/trunk/README.md
    jmeter/trunk/build.xml
    jmeter/trunk/xdocs/building.xml
    jmeter/trunk/xdocs/changes.xml
Comment 10 Felix Schumacher 2017-03-23 21:08:32 UTC
Date: Thu Mar 23 21:07:53 2017
New Revision: 1788325

URL: http://svn.apache.org/viewvc?rev=1788325&view=rev
Log:
Add properties to skip tests, that fail in environments without proper internet access, ie. are behind
a proxy. Contributed by Michael Osipov.

Bugzilla Id: 60886

Modified:
    jmeter/trunk/README.md
    jmeter/trunk/build.xml
    jmeter/trunk/test/src/org/apache/jmeter/protocol/http/control/TestDNSCacheManager.java
    jmeter/trunk/xdocs/building.xml
    jmeter/trunk/xdocs/changes.xml
Comment 11 Felix Schumacher 2017-03-23 21:13:10 UTC
Thanks for your patches and feedback and I hope this enables your builds in your environment.
Comment 12 Michael Osipov 2017-03-24 09:28:42 UTC
Way better now. You forgot to document the proxy.use=true property in the RADME.md file.
Comment 13 Felix Schumacher 2017-03-24 19:03:30 UTC
Date: Fri Mar 24 18:58:07 2017
New Revision: 1788530

URL: http://svn.apache.org/viewvc?rev=1788530&view=rev
Log:
Add docs for property proxy.use and change Michael's email.

Bugzilla Id: 60886

Modified:
    jmeter/trunk/README.md
    jmeter/trunk/xdocs/building.xml
    jmeter/trunk/xdocs/changes.xml
Comment 14 Philippe Mouawad 2017-09-02 19:40:20 UTC
*** Bug 60435 has been marked as a duplicate of this bug. ***
Comment 15 The ASF infrastructure team 2022-09-24 20:38:08 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/4339