Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chasing openstacksdk failures. #233

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions openstacksdk-2024.2/PREPATCH
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
prepatch001-debug-failing-test.patch
28 changes: 28 additions & 0 deletions openstacksdk-2024.2/prepatch001-debug-failing-test.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
diff --git a/openstack/tests/unit/test_stats.py b/openstack/tests/unit/test_stats.py
index 6a466b1bb..274a50654 100644
--- a/openstack/tests/unit/test_stats.py
+++ b/openstack/tests/unit/test_stats.py
@@ -131,8 +131,10 @@ class TestStats(base.TestCase):
stats = itertools.chain.from_iterable(
[s.decode('utf-8').split('\n') for s in self.statsd.stats]
)
+ considered_stats = []
for stat in stats:
k, v = stat.split(':')
+ considered_stats.append((k, v))
if key == k:
if kind is None:
# key with no qualifiers is found
@@ -160,7 +162,11 @@ class TestStats(base.TestCase):
return True
time.sleep(0.1)

- raise Exception("Key %s not found in reported stats" % key)
+ raise Exception(
+ "Key {} not found in reported stats {}".format(
+ key, considered_stats
+ )
+ )

def assert_prometheus_stat(self, name, value, labels=None):
sample_value = self._registry.get_sample_value(name, labels)
26 changes: 26 additions & 0 deletions testapply.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,34 @@ for project in ${positional_args}; do
cd ${topsrcdir}/${directory}
git checkout -b ${branch}-patches
echo -e "${H2}Working in branch ${branch}-patches${Color_Off}"
cd ${topdir}

if [ -e ${project}/PREPATCH ]; then
for patch in $(cat ${project}/PREPATCH)
do
echo
shortpatch=$(echo $patch | cut -f 2 -d "/" | cut -f 1 -d "-")

echo -e "${H3}Applying ${branch} ${project}/${patch}${Color_Off}"
git -C ${topsrcdir}/${directory} apply -v ${topdir}/${project}/${patch}
if [ $? -gt 0 ]; then
echo -e "${H3}Applying ${branch} ${project}/${patch} failed!${Color_Off}"
exit 1
fi

pushd ${topsrcdir}/${directory}
echo -e "${H3}Commiting ${branch} ${patch}${Color_Off}"
git add -A .
git status
git commit -a -m "${patch}"
echo

popd
done
fi

echo -e "${H3}Ensure tests pass on a clean ${project} ${branch} branch${Color_Off}"
cd ${topsrcdir}/${directory}
if [ "${defer_tests}" != "true" ]; then
run_tests ${repo} ${branch}
fi
Expand Down
Loading