Kiwi TCMS 8.0

major release with backwards incompatible changes

Posted by Kiwi TCMS Team on Wed 12 February 2020 under releases

We're happy to announce Kiwi TCMS version 8.0!

IMPORTANT: this is a major release which includes important database and API changes, several improvements and bug fixes. Multiple API methods are now incompatible with older releases and extra caution needs to be applied when upgrading via docker-compose.yml because newer MariaDB versions are breaking direct upgrades from existing installations!

You can explore everything at https://public.tenant.kiwitcms.org!

Supported upgrade paths:

5.3   (or older) -> 5.3.1
5.3.1 (or newer) -> 6.0.1
6.0.1            -> 6.1
6.1              -> 6.1.1
6.1.1            -> 6.2 (or newer)

Docker images:

kiwitcms/kiwi       latest  71a55e353da2    557 MB
kiwitcms/kiwi       6.2     7870085ad415    957 MB
kiwitcms/kiwi       6.1.1   49fa42ddfe4d    955 MB
kiwitcms/kiwi       6.1     b559123d25b0    970 MB
kiwitcms/kiwi       6.0.1   87b24d94197d    970 MB
kiwitcms/kiwi       5.3.1   a420465852be    976 MB

Changes since Kiwi TCMS 7.3

Improvements

  • Update Django from 3.0.2 to 3.0.3
  • Update django-grappelli from 2.13.3 to 2.14.1
  • Update markdown from 3.1.1 to 3.2
  • Update python-gitlab from 1.15.0 to 2.0.1
  • Update pygithub from 1.45 to 1.46
  • Allow customization of test execution statuses via admin. For more information see https://kiwitcms.readthedocs.io/en/latest/admin.html#test-execution-statuses. Fixes Issue #236
  • Add passing rate chart to Execution trends telemetry
  • Documentation updates (@Prome88)

Database

This release adds several migrations which alter the underlying database schema by renaming multiple columns.

WARNINGS:

  • SQLite has very poor capabilities for altering schema and it will break when run with existing database! If you had deployed Kiwi TCMS with SQLite for production purposes you will not be able to upgrade! We recommend switching to Postgres first and then upgrading!

  • docker-compose.yml has been updated from MariaDB 5.5 to MariaDB 10.3. The 10.x MariaDB containers change their datadir configuration from /var/lib/mysql to /var/lib/mysql/data! We recommend first upgrading your MariaDB version, using Kiwi TCMS 7.3 and afterwards upgrading to Kiwi TCMS 8.0:

    1. Backup existing database with:

      docker exec -it kiwi_db mysqldump -u kiwi -pYourPass kiwi > backup.sql
      
    2. docker-compose down

    3. docker volume rm kiwi_db_data - will remove existing data volume b/c of incompatibilities between different MariaDB versions

    4. docker-compose up - will recreate data volume with missing data. e.g. manage.py showmigrations will report that 0 migrations have been applied.

    5. Restore the data from backup:

      cat backup.sql | docker exec -u 0 -i kiwi_db /opt/rh/rh-mariadb103/root/usr/bin/mysql kiwi
      

      note: This connects to the database as the root user

    6. Proceed to upgrade your Kiwi TCMS container !

CHANGES:

  • Remove model fields of type AutoField. They are a legacy construct and shouldn't be specified in the source code! Django knows how to add them dynamically. These are:
    • Tag.id
    • TestCaseStatus.id
    • Category.id
    • PlanType.id
    • TestExecutionStatus.id
  • Remove db_column attribute from model fields
  • Rename several primary key fields to id:
    • Build.build_id -> Build.id
    • TestRun.run_id -> TestRun.id
    • TestPlan.plan_id -> TestPlan.id
    • TestCase.case_id -> TestCase.id
    • TestExecution.case_run_id -> TestExecution.id

API

WARNING:

The database schema changes mentioned above affect multiple API methods in a backwards incompatible way! There is possibility that your API scripts will also be affected. You will have to adjust those to use the new field names where necessary!

CHANGES:

  • Methods Build.create(), Build.filter() and Build.update() will return id instead of build_id field
  • Method TestRun.get_cases() will return execution_id instead of case_run_id field and id instead of case_id field
  • Methods TestRun.add_case(), TestExecution.create(), TestExecution.filter() and TestExecution.update() will return id instead of case_run_id field
  • Methods TestRun.create(), TestRun.filter(), TestRun.update() will return id instead of run_id field
  • Methods TestPlan.create(), TestPlan.filter() and TestPlan.update() will return id instead of plan_id field
  • Methods TestCase.add_component(), TestCase.create(), TestCase.filter() and TestCase.update() will return id instead of case_id field

NOTES:

Kiwi TCMS automation framework plugins have been updated to work with the newest API. At the time of Kiwi TCMS v8.0 release their versions are:

  • kiwitcms-tap-plugin v8.0.1
  • kiwitcms-junit.xml-plugin v8.0.1
  • kiwitcms-junit-plugin v8.0

Bug fixes

  • Allow displaying lists with more then 9 items when reviewing test cases. Fixes Issue #339 (Mfon Eti-mfon)
  • Make tcms.tests.storage.RaiseWhenFileNotFound` capable of finding finding static files on Windows which enables development mode for folks not using Linux environment. See SO #55297178 (Mfon Eti-mfon)
  • Allow changing test execution status without adding comment. Fixes Issue #1261
  • Properly refresh test run progress bar when changing statuses. Fixes Issue #1326
  • Fix a bug where updating test cases from the UI was causing text and various other fields to be reset. Fixes Issue #1318

Refactoring

  • Extract attachments widget to new template. Fixes Issue #1124 (Rosen Sasov)
  • Rename RPC related classes. Fixes Issue #682 (Rosen Sasov)
  • Add new test (Mariyan Garvanski)
  • Start using GitHub actions, first for running flake8
  • Remove unused TestCase.get_previous_and_next()
  • Remove unused TestCaseStatus.string_to_instance()
  • Remove unused TestCase.create()
  • Remove unused json_success_refresh_page()
  • Remove unused fields from SearchPlanForm
  • Use JSON-RPC in previewPlan()
  • Remove toggleTestCaseContents(), duplicate of toggleTestExecutionPane()
  • Refactor a few more views to class-based

GitHub Marketplace listing deprecation

As we've stated previously Kiwi TCMS has migrated to a new GitHub backend and OAuth tokens for the previous backend have been revoked and the existing listing on GitHub Marketplace is deprecated. It is a non-functioning app at the moment!

It is not possible for us to cancel Marketplace subscriptions programatically, that is GitHub does not provide such API. Active subscribers please follow these 3 steps to help us clean up stale information:

  • Go to https://github.com/marketplace/kiwi-tcms
  • From "Edit your plan" button at the top select your GitHub account
  • Then click "Cancel this plan" link which is at the left-hand side at the bottom of the description box!

How to upgrade

Backup first! If you are using Kiwi TCMS as a Docker container then:

cd path/containing/docker-compose/
docker-compose down
docker pull kiwitcms/kiwi
docker pull centos/mariadb-103-centos7
docker-compose up -d
docker exec -it kiwi_web /Kiwi/manage.py migrate

WHERE: docker-compose.yml has been updated from your private git repository! The file provided in our GitHub repository is an example. Not for production use!

WARNING: kiwitcms/kiwi:latest and docker-compose.yml will always point to the latest available version! If you have to upgrade in steps, e.g. between several intermediate releases, you have to modify the above workflow:

# starting from an older Kiwi TCMS version
docker-compose down
docker pull kiwitcms/kiwi:<next_upgrade_version>
edit docker-compose.yml to use kiwitcms/kiwi:<next_upgrade_version>
docker-compose up -d
docker exec -it kiwi_web /Kiwi/manage.py migrate
# repeat until you have reached latest

Happy testing!