Merge autopkgtest-cloud:lpci-run-unit-tests into autopkgtest-cloud:master

Proposed by Brian Murray
Status: Merged
Merged at revision: 3716bed1aaf666d5203faabe6366d73cd685c093
Proposed branch: autopkgtest-cloud:lpci-run-unit-tests
Merge into: autopkgtest-cloud:master
Diff against target: 11 lines (+1/-0)
1 file modified
.launchpad.yaml (+1/-0)
Reviewer Review Type Date Requested Status
Paride Legovini Needs Information
Tim Andersson Pending
Review via email: mp+451391@code.launchpad.net

Description of the change

It looks like adding the unit tests to the pipeline was missed. This fixes that.

To post a comment you must log in.
Revision history for this message
Brian Murray (brian-murray) wrote :

Well unit_tests passed locally, so maybe its something with how it is run in Launchpad?

Revision history for this message
Tim Andersson (andersson123) wrote :

@ paride this is why I had the exception hook here for CI and local before

Revision history for this message
Tim Andersson (andersson123) wrote :

I think maybe there's some proxy rules that mean login.ubuntu.com is localhost, because I can't reproduce this locally with lpci

Revision history for this message
Tim Andersson (andersson123) wrote :

I've asked the lpci guys about this, hopefully they get back to us soon

Revision history for this message
Paride Legovini (paride) wrote :

The issue may be related to the http proxy, and to the fact that the proxy may deny connections to launchpad.net. Can you try adding this mapping:

environment:
  no_proxy: .launchpad.net

to the unit_test job in .launchpad.yaml? E.g.

    [...]
    snaps:
      - name: yq
    environment:
      no_proxy: .launchpad.net
    run-before: |
    [...]

and push the change to this branch? Let's see how it behaves. (Add it to a separate commit so it's easy to drop if proven useless).

review: Needs Information
Revision history for this message
Brian Murray (brian-murray) wrote :

I was able to recreate this locally by adding the following to the .launchpad.yaml:

+ environment:
+ http_proxy: http://squid.internal:3128
+ https_proxy: http://squid.internal:3128

The actual failure was with login.ubuntu.com so that needs to be added to no_proxy:

+ no_proxy: login.ubuntu.com

Revision history for this message
Brian Murray (brian-murray) wrote :

I don't know if it will be helpful but this is what I see during a pass when running it locally:

2023-09-15 09:45:31.165 :: Ran 58 tests in 1.574s
2023-09-15 09:45:31.165 ::
2023-09-15 09:45:31.165 :: OK
2023-09-15 09:45:31.165 :: [call.Request(url='https://example.com', method='POST', data=b'{"bar": 2}', headers={'Content-Type': 'application/json', 'Authorization': 'Basic dXNlcjpzM2tyMXQ='}),
2023-09-15 09:45:31.165 :: call.urlopen(<MagicMock name='request.Request()' id='140119115375952'>),
2023-09-15 09:45:31.165 :: call.urlopen().__enter__(),
2023-09-15 09:45:31.165 :: call.urlopen().__enter__().geturl(),
2023-09-15 09:45:31.165 :: call.urlopen().__enter__().getcode(),
2023-09-15 09:45:31.166 :: call.urlopen().__enter__().read(),
2023-09-15 09:45:31.166 :: call.urlopen().__exit__(None, None, None)]

Revision history for this message
Tim Andersson (andersson123) wrote :

Looks like it didn't work in CI still. Let's wait and see what the LPCI devs say and see if they can help us

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/.launchpad.yaml b/.launchpad.yaml
2index e41b311..56a622c 100644
3--- a/.launchpad.yaml
4+++ b/.launchpad.yaml
5@@ -1,5 +1,6 @@
6 pipeline:
7 - pre_commit
8+ - unit_tests
9 - build_charms
10
11 jobs:

Subscribers

People subscribed via source and target branches