Remove migration constant job and test

Since openstack release naming conventions has changed, current test
which check data migration version will not work as expected and same
is also blocking our gate. Removing this job and test to unblock the
gate.

NOTE: Going forward glance PTL/team needs to change the database
migration version without fail at the start of release cycle.

Change-Id: Idcb12a6c450d4ce4ee859e6e1f02fb71adf8c1d5
This commit is contained in:
Abhishek Kekane 2023-01-16 14:40:29 +00:00
parent e9b40e1316
commit d07187f710
5 changed files with 0 additions and 98 deletions

View File

@ -1,21 +1,3 @@
- job:
name: glance-code-constants-check
parent: tox
description: |
Tests to catch when code constants have gotten out of sync.
vars:
tox_envlist: gateonly
irrelevant-files:
- ^(test-|)requirements.txt$
- ^.*\.rst$
- ^api-ref/.*$
- ^doc/.*$
- ^etc/.*$
- ^releasenotes/.*$
- ^setup.cfg$
- ^tox.ini$
- ^\.zuul\.yaml$
- job:
name: glance-tox-oslo-tips-base
parent: tox
@ -321,7 +303,6 @@
- openstack-tox-functional-py38-fips
- openstack-tox-functional-py39
- glance-tox-functional-py39-rbac-defaults
- glance-code-constants-check
- glance-ceph-thin-provisioning:
voting: false
irrelevant-files: &tempest-irrelevant-files

View File

@ -1,11 +0,0 @@
===============
Gate-only tests
===============
These tests catch configuration problems for some code constants that
must be maintained manually. We have them separated out from the other
tests so that they can easily be run in their own gate job and don't
affect local development.
It would be nice if someone with some free time could figure out how
to make these changes automatic (or unnecessary) ...

View File

@ -1,57 +0,0 @@
# Copyright 2019 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import testtools
from glance.db.migration import CURRENT_RELEASE
from glance.version import version_info
class TestDataMigrationVersion(testtools.TestCase):
def test_migration_version(self):
"""Make sure the data migration version info has been updated."""
release_number = int(version_info.version_string().split('.', 1)[0])
# by rule, release names must be composed of the 26 letters of the
# ISO Latin alphabet (ord('A')==65, ord('Z')==90)
release_letter = str(CURRENT_RELEASE[:1].upper()).encode('ascii')
# Convert release letter into an int in [1:26]. The first
# glance release was 'Bexar'.
converted_release_letter = (ord(release_letter) -
ord(u'B'.encode('ascii')) + 1)
# Project the release number into [1:26]
converted_release_number = release_number % 26
# Prepare for the worst with a super-informative message
msg = ('\n\n'
'EMERGENCY!\n'
'glance.db.migration.CURRENT_RELEASE is out of sync '
'with the glance version.\n'
' CURRENT_RELEASE: %s\n'
' glance version: %s\n'
'glance.db.migration.CURRENT_RELEASE needs to be '
'updated IMMEDIATELY.\n'
'The gate will be wedged until the update is made.\n'
'EMERGENCY!\n'
'\n') % (CURRENT_RELEASE,
version_info.version_string())
self.assertEqual(converted_release_letter,
converted_release_number,
msg)

11
tox.ini
View File

@ -67,17 +67,6 @@ basepython = python3
commands =
oslopolicy-sample-generator --config-file=etc/glance-policy-generator.conf
[testenv:gateonly]
# NOTE(rosmaita): these tests catch configuration problems for some code
# constants that must be maintained manually; we have them separated out
# so they don't affect local development
# TODO(someone other than me): figure out how to make these changes either
# automatic or unnecessary
setenv =
TEST_PATH = ./glance/tests/gate
commands =
stestr run {posargs}
[testenv:pep8]
commands =
flake8 {posargs}