Merge lp://staging/~cprov/uci-engine/1335753-glance-creds into lp://staging/uci-engine

Proposed by Celso Providelo
Status: Needs review
Proposed branch: lp://staging/~cprov/uci-engine/1335753-glance-creds
Merge into: lp://staging/uci-engine
Diff against target: 332 lines (+203/-32)
5 files modified
ci-utils/ci_utils/tests/test_unit_config.py (+125/-0)
ci-utils/ci_utils/unit_config.py (+57/-16)
juju-deployer/configs/unit_config.yaml.tmpl (+13/-5)
juju-deployer/deploy.py (+6/-6)
juju-deployer/test_deploy.py (+2/-5)
To merge this branch: bzr merge lp://staging/~cprov/uci-engine/1335753-glance-creds
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Andy Doan (community) Approve
Vincent Ladeuil (community) Needs Fixing
Review via email: mp+225248@code.staging.launchpad.net

Commit message

Independent set of credentials for ImageBuilder and TestRunner in unit_config.

Description of the change

Resuming Vincent's work for creating an independent set of credentials for using in ImageBuilder and TestRunner, since they may operate in an different environment (cloud) than they are deployed.

Original MP -> https://code.launchpad.net/~vila/uci-engine/1335753-glance-creds/+merge/225191

To post a comment you must log in.
634. By Celso Providelo

adding missing test.

635. By Celso Providelo

Adding missing docstring.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:635
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/990/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/990/rebuild

review: Needs Fixing (continuous-integration)
636. By Celso Providelo

Fixing test failures.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:636
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/992/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/992/rebuild

review: Approve (continuous-integration)
Revision history for this message
Vincent Ladeuil (vila) wrote :
Download full text (9.5 KiB)

Typos aside, there is an issue with tests creating and removing unit_config at the root of the branch.

With a full deployment available on hp and GLANCE_* vars defined, I get:

$ ./run-tests
<...>

======================================================================
ERROR: tests.test_test_runner.TestTestRunner.test_process_ticket
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/test_test_runner.py", line 90, in test_process_ticket
    raise_errors=True)
  File "/home/vila/ci/uci-engine/reviews/1335753-glance-creds/ci-utils/ci_utils/amqp_utils.py", line 99, in send
    conn, channel = declare_queue(queue_name, config)
  File "/home/vila/ci/uci-engine/reviews/1335753-glance-creds/ci-utils/ci_utils/amqp_utils.py", line 83, in declare_queue
    raise e
error: [Errno 110] Connection timed out
======================================================================
FAIL: juju-deployer.test_deploy.TestCheckEnvironment.test_check_environment_defaults
----------------------------------------------------------------------
Traceback (most recent call last):
  File "build/bdist.linux-x86_64/egg/mock.py", line 1201, in patched
    return func(*args, **keywargs)
  File "juju-deployer/test_deploy.py", line 77, in test_check_environment_defaults
    self.assertEqual('', os.environ['GLANCE_OS_USERNAME'])
  File "/usr/lib/python2.7/unittest/case.py", line 515, in assertEqual
    assertion_func(first, second, msg=msg)
  File "/usr/lib/python2.7/unittest/case.py", line 508, in _baseAssertEqual
    raise self.failureException(msg)
AssertionError: '' != '<email address hidden>'

Ran 594 tests in 501.909s
FAILED (failures=2)

test_process_tickey is now understood as missing an exposed rabbit.

But re-running:
$ ./run-tests
<...>
======================================================================
ERROR: test_runner.tstrun.tests.test_data_store.TestDataStore.test_put_file_stores_content
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_runner/tstrun/tests/test_data_store.py", line 62, in setUp
    tstrun.get_auth_config(), public=True)
  File "test_runner/tstrun/__init__.py", line 28, in get_auth_config
    with open(path) as f:
IOError: [Errno 2] No such file or directory: '/home/vila/ci/uci-engine/reviews/1335753-glance-creds/unit_config'
======================================================================
ERROR: test_runner.tstrun.tests.test_data_store.TestDataStore.test_store_created_empty
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_runner/tstrun/tests/test_data_store.py", line 62, in setUp
    tstrun.get_auth_config(), public=True)
  File "test_runner/tstrun/__init__.py", line 28, in get_auth_config
    with open(path) as f:
IOError: [Errno 2] No such file or directory: '/home/vila/ci/uci-engine/reviews/1335753-glance-creds/unit_config'
======================================================================
ERROR: test_runner.tstrun.tests.test_testbed.TestTestbed.test_create_new_ssh_key
-----------------------------------------------------...

Read more...

review: Needs Fixing
Revision history for this message
Vincent Ladeuil (vila) wrote :

I'll dig further and try to fix those.

637. By Celso Providelo

merge trunk

638. By Celso Providelo

FIxing typos and test env var isolation.

Revision history for this message
Celso Providelo (cprov) wrote :

The fact that we have tests that depend on 'unit_config' on the project root is wrong, in fact. If it's not committed in the VCS it should be handled ad-hoc by a testing fixture.

Also, the only test that needs to exercise disk operations with 'unit_config' is the one I've added in this branch, all the rest of the system should mock get_auth_config() and use whatever result they expect.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:638
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/996/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/996/rebuild

review: Approve (continuous-integration)
Revision history for this message
Vincent Ladeuil (vila) wrote :

> The fact that we have tests that depend on 'unit_config' on the project root
> is wrong, in fact.
> If it's not committed in the VCS it should be handled ad-
> hoc by a testing fixture.

There is more than one way to do it :)

The tests that rely on unit_config do use fixtures but still let the user decide whether or not he want to run those tests by creating that file or not.

If you have a better way that doesn't break the existing tests, I'm fine with that.

>
> Also, the only test that needs to exercise disk operations with 'unit_config'
> is the one I've added in this branch, all the rest of the system should mock
> get_auth_config() and use whatever result they expect.

Yes, that's the point I raised when you introduced deploy.install_unit_config()... I don't know which tests required that.

Revision history for this message
Andy Doan (doanac) wrote :

I mostly like it. I noticed a bug a though. I think any test failing because it assumes the location of the unit-config should be considered broken. I've got MP's on the way:

 https://code.launchpad.net/~doanac/uci-engine/lander-code-layout/+merge/225046

that are placing unit_config *outside* our code directory, so moving forward this assumption will definitely not work.

Revision history for this message
Celso Providelo (cprov) wrote :

Thanks for the review Andy, comments addressed inline.

639. By Celso Providelo

Re-implement unit_config module get() for not breaking possibly untested code.

Revision history for this message
Andy Doan (doanac) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:639
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/1001/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/1001/rebuild

review: Approve (continuous-integration)
640. By Celso Providelo

unit_config.get() not deprecated anymore, it's useful.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:640
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/1006/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/1006/rebuild

review: Approve (continuous-integration)
641. By Celso Providelo

merge trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:641
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/1017/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/1017/rebuild

review: Needs Fixing (continuous-integration)

Unmerged revisions

641. By Celso Providelo

merge trunk

640. By Celso Providelo

unit_config.get() not deprecated anymore, it's useful.

639. By Celso Providelo

Re-implement unit_config module get() for not breaking possibly untested code.

638. By Celso Providelo

FIxing typos and test env var isolation.

637. By Celso Providelo

merge trunk

636. By Celso Providelo

Fixing test failures.

635. By Celso Providelo

Adding missing docstring.

634. By Celso Providelo

adding missing test.

633. By Celso Providelo

Making GLANCE_* variables optional and adding tests for ci_utils.unit_config.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches