0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

doing tox for OpenStack keystone on conda python 3.7 environment

Last updated at Posted at 2018-11-05

목표

the goal

다음과 같이 centos, conda python 3.7 환경에서 keystone 코드를 tox로 테스트 해 봅니다.
is to test OpenStack keystone with tox on conda python 3.7

image.png

miniconda를 install합니다.
let's start with installing miniconda

절차

procedures

먼저 conda를 설치합니다.
first, let's install miniconda3

wget -L https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
sh ./Miniconda3-latest-Linux-x86_64.sh
....
source ./miniconda3/bin/activate base

image.png

keystone 프로젝트를 위한 python환경을 설치합니다.
and create a python3 environment for keystone project

conda create -n keystone -c conda-forge git python=3
conda activate keystone
cd $CONDA_PREFIX
mkdir projects && cd projects
git clone http://github.com/openstack/keystone -b stable/rocky --depth 1

image.png

tox가 가상환경을 만들어 dependency를 인스톨하는데 필요한 소스코드도 설치합니다.
let's install source dependencies for tox virtualenv

yum install python36-devel openldap-devel

conda의 python 버전이 3.7이므로 tox.ini를 열어서 py35로 되어있는 것을 py37로 고칩니다.
fix py35 to py37 in tox.ini as python version of conda environment is 3.7

image.png

tox -e py37

image.png

아이고, 17개 실패했습니다.
oops, 17 tests failed.

어디가 실패했는 지 살펴봅니다.
let's find out what is wrong.

tox -e py37 > result.txt

sqlite의 migration테이블이 없다는군요.
it says 'no such table'

image.png

그럼 마이그레이션을 하지 않는 테스트를 시험해 봅니다. 예를 들면 test_cli 유닛테스트같은 것을요.

then, let's try again only with tests not to use migration things like test_cli unit test.

tox -e py37 -- keystone.tests.unit.test_cli

image.png

넵. 필요한 테스트를 수행했습니다.
yep, we did it. good job 👏👏👏

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?