Proxy tests failing in the autopkgtest environment

Bug #1940104 reported by Lucas Kanashiro
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
r10k (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Failures:

  1) R10K::Settings global settings proxy setting a default value respects the HTTP_PROXY environment variable
     Failure/Error: expect(output[:proxy]).to eq("http://proxy.value/#{env_var}")

       expected: "http://proxy.value/HTTP_PROXY"
            got: "http://squid.internal:3128"

       (compared using ==)
     # ./spec/unit/settings_spec.rb:237:in `block (7 levels) in <top (required)>'
     # ./spec/unit/settings_spec.rb:235:in `block (6 levels) in <top (required)>'

  2) R10K::Settings global settings proxy setting a default value respects the http_proxy environment variable
     Failure/Error: expect(output[:proxy]).to eq("http://proxy.value/#{env_var}")

       expected: "http://proxy.value/http_proxy"
            got: "http://squid.internal:3128"

       (compared using ==)
     # ./spec/unit/settings_spec.rb:237:in `block (7 levels) in <top (required)>'
     # ./spec/unit/settings_spec.rb:235:in `block (6 levels) in <top (required)>'

Those tests are failing because the Ubuntu autopkgtest infrastructure uses the same variables the tests are trying to update. They should be skipped when executed under those circumstances.

Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

The attached debdiff fixes this issue.

Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :
Revision history for this message
Athos Ribeiro (athos-ribeiro) wrote :

Thanks, Lucas! LGTM

At first I thought this change could be forwarded upstream if instead of verifying the AUTOPKGTEST_TMP env variable we verified the env variables were not defined before overriding them.

Then I realized that the functions used to do so are indeed running in a somewhat contained scope: https://github.com/puppetlabs/r10k/blob/main/lib/r10k/util/exec_env.rb#L27. It seems that the autopkgtest infrastructure will (thankfully) not allow overrides to the proxy settings.

Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Thanks for the review Athos! I am going to upload the package.

tags: added: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package r10k - 3.7.0-2ubuntu1

---------------
r10k (3.7.0-2ubuntu1) impish; urgency=medium

  * d/p/20_disable_test_changing_proxy_settings: skip tests trying to change
    the proxy settings, they are failing in the Ubuntu autopkgtest
    infrastructure (LP: #1940104).

 -- Lucas Kanashiro <email address hidden> Mon, 16 Aug 2021 11:49:31 -0300

Changed in r10k (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.