los-cocos / cocos-testcmp

0 stars 1 forks source link

Overview

Testing in cocos is accomplished by

The report is a html page that tells

If one of the version selected is the reference version, and

then the other version is considered good.

To consider a cocos version good to release, individual runs with py lower, py last, pyglet lower, pyglet high must be all good.

So, how is the workflow ?

Sugestion: if fixing cocos, do your coding in a separate clone, commit, go to the clone under work/, checkout master, do a pull, edit conf.py for the new cocos checkout to use.

Preparation

Here are the commands and editions to do, copy it and

Setting the main python venv, clone cocos-testcmp, move to the clone's working dir::

D:\dev>py -3.8 -m venv d:\venvs\py38_cmp
D:\dev>d:\venvs\py38_cmp\Scripts\activate
(py38_cmp) D:\dev>python -m pip install pip -U
(py38_cmp) D:\dev>git clone git@github.com:los-cocos/cocos-testcmp.git
(py38_cmp) D:\dev>cd cocos-testcmp

Edit conf.py

- ``main_venv_python = [r"d:\venvs\py38_cmp\Scripts\python.exe"]``

- If you are not ccanepa, or are working from a fork, you may need to adjust the URLs for cocos, cocos-testcmp and remembercases

- In  linux also pyversions_available should be configured

Initialize work/ subtree, install cocos-testcmp in the main python venv::

(py38_cmp) D:\dev\cocos-testcmp>python 00_init.py
(py38_cmp) D:\dev\cocos-testcmp>python -m pip install -e .

This concludes the preparation list; see below sections for details.

When the list is completed, go to the section "Test loop" for details on running comparisons

Setting the venv

Cloning cocos-testcmp

Clone cocos-testcmp, the repo_url depends if you are getting it from the official repo or a forked repo, and the git protocol to use (https or git over SSH)::

git clone repo_url

By example, from the official repo and with https::

git clone https://github.com/los-cocos/cocos-testcmp.git

Now cocos-testcmp/ will hold the Working Directory (WD) of the repo, and it will be in the default branch, 'main' because that is the new style, not 'master'. If you are developing cocos-testcmp, switch to the desired branch, else let it alone.

Just to not forget, do a cd to move to the Working Directory.

Initial configuration


Don't skip this, else you will get a bunch of tracebacks later.

The file cocos-testcmp/conf.py is the one to edit.

That ends the preparation phase.

Note: in linux you may want to test if numpy and pillow can be imported in the venv with::

python -c "import numpy"
python -c "import PIL"

and if not resolve the problem before continue.

By example, in a raspi3 with raspbian buster the cocos-testcmp install, which triggers a numpy install, terminated normally, reporting that numpy installed correctly. But when do_test triggered a numpy import it crashed.

The traceback included a link to a page with suggestions about how to solve import numpy problems; in the end::

sudo apt-get install libatlas-base-dev

solved the problem.

On the other side, Pillow worked right without any massaging.

Test loop

Extra tests

When doing a cocos release, once the comparison part is satisfactory scripts outside test/ should be tested, meaning a manual run and eyeballing they look good

Tips