~vila/ols-store-tests/redirection-failures

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
Getting started
===============

0. Setup the environment

Because the tests rely on certain dependencies that are only available on
Ubuntu 16.04 or later, the supported way to run these tests is using LXCs.
There's some additional documentation on LXC gotchas in the following
page (check there specially if you can't resolve the lxc address when
ssh'ing and if you want to open GUI apps seeing them in your host machine):

   https://wiki.canonical.com/UbuntuOne/Developer/LXC

To get started, make sure you have LXC installed an ready to use on
the host computer:

   $ sudo apt-get install libvirt-bin lxc

Once it's installed, the current supported version of Ubuntu is Xenial 16.10.
We'll create a new container specifically for this project to isolate it from
the system and other projects:

   $ sudo lxc-create -t ubuntu -n sca-xenial -- -r xenial -a amd64 -b $USER

Once it's created, lets start the container and log in with your
existing credentials:

   $ sudo lxc-start -n sca-xenial -d
   $ ssh -A sca-xenial

From now on, instructions will assume you're inside the sca-xenial LXC, unless
otherwise noted.

To set the prerequisites up inside the container, you can run the setup-container script
with sudo (needed to install packages and change system config inside the container)::

   $ sudo ./setup-container

If you run into trouble or want to perform one or more steps manually, have a look at the
setup-container script, which is quite simple and commented.

1. Get the code
::

.. note::
    You need to install, configure and setup bzr and ssh keys. See BAZAAR below.

    $ bzr branch lp:~ubuntuone-pqm-team/ols-store-tests/store-acceptance-tests
    $ cd store-acceptance-tests


2. Run the tests
::

    $ make api-tests

.. note::

   If you want to run a sub set of the tests only, you should do...

     $ make api-tests TEST_TARGET=tests.api.snap.test_snap_release
     $ make api-tests TEST_TARGET=tests.api.snap.test_snap_release.SnapReleaseTestCase.test_release_snap_require_package_upload_permission

Tests are run against staging by default. If you want to run the tests against a local instance
of devportal, you need to:

1. configure your local devportal instance to use staging SSO

2. ensure you have logged into your local devportal instance with a user, you have accepted the developer agreement
   and you have defined a namespace for that account.

Then you can run the tests against your local devportal instance like::

   $ SCA_ROOT_URL=http://<ip>:<port> make api-tests

ols jenkaas setup
=================

Merge proposals are gated on https://jenkins.ols.canonical.com which relies
on ols-vms (from ppa:ubuntuone/ols-tests) to setup the lxd container defined
in ols-vms.conf.

Setting up the same container locally is done with:

$ ols-vms setup store-acceptance-tests -Olxd.user_mounts=~:/home/ubuntu,<path to secrets>:/home/ubuntu/.config/ols-store-acceptance-tests

``<path to secrets`` should contain a ``secrets`` file exporting the
TEST_USER_EMAIL, TEST_USER_PASSWORD, TEST_USER_NAMESPACE and
STRIPE_PUBLISHABLE_KEY.

Once the container is setup you can enter it with:

$ ols-vms shell store-acceptance-tests

Once there, 'cd' to your mounted working dir and 'make bootstrap'.

ols jenkaas uses './run-landing-tests.sh'.