Skip to content

Commit ea2682a

Browse files
Merge pull request #3943 from manticoresoftware/test/add-check-blog-grafana
test: add blog validation for Grafana versions
2 parents c50923c + 550a03f commit ea2682a

File tree

1 file changed

+39
-26
lines changed

1 file changed

+39
-26
lines changed

test/clt-tests/integrations/grafana/test-integrations-check-grafana-versions.rec

Lines changed: 39 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ TESTED_VERSIONS="10.0
2626
12.2"
2727

2828
# Check for NEW versions (after latest tested)
29+
# WARNING: Also update GRAFANA_LATEST below when changing this!
2930
LATEST_TESTED_VERSION="12.2"
3031
NEW_VERSIONS=$(curl -s "https://hub.docker.com/v2/repositories/grafana/grafana/tags/?page_size=100" \
3132
| jq -r ".results[].name" \
@@ -43,27 +44,13 @@ function version_compare(v1, v2) {
4344
version_compare($0, latest) > 0')
4445

4546
if [ -n "$NEW_VERSIONS" ]; then
46-
echo "🆕 NEW Grafana versions detected:"
47-
echo "$NEW_VERSIONS"
47+
echo "🆕 NEW Grafana versions detected: $NEW_VERSIONS"
4848
echo ""
49-
echo "❌ Need to test new versions and update the following:"
50-
echo ""
51-
echo "📝 Files to update:"
52-
echo " 1. test/clt-tests/integrations/grafana/test-integrations-check-grafana-versions.rec"
53-
echo " - Update TESTED_VERSIONS list"
54-
echo " - Update LATEST_TESTED_VERSION='$LATEST_TESTED_VERSION' -> new version"
55-
echo ""
56-
echo " 2. test/clt-tests/integrations/grafana/test-integrations-test-grafana-versions.rec"
57-
echo " - Add new test section: timeout 300 bash /tmp/grafana-single-test.sh X.X"
58-
echo ""
59-
echo " 3. Update documentation with new version support:"
60-
echo " - manual/english/Changelog.md (add release note about new version support)"
61-
echo ""
62-
echo " 4. Update website content (separate repository):"
63-
echo " - https://github.com/manticoresoftware/site"
64-
echo " - content/english/blog/manticoresearch-grafana-integration/index.md"
65-
echo " - Search for: 'compatible with Grafana versions up to X.X'"
66-
echo " - Update version number to latest tested"
49+
echo "📝 Update required:"
50+
echo " 1. test-integrations-check-grafana-versions.rec - Update TESTED_VERSIONS and LATEST_TESTED_VERSION"
51+
echo " 2. test-integrations-test-grafana-versions.rec - Add test for new version"
52+
echo " 3. manual/english/Changelog.md - Add release note"
53+
echo " 4. site repo: blog/manticoresearch-grafana-integration/index.md"
6754
echo ""
6855
exit 1
6956
else
@@ -89,9 +76,35 @@ Using tested versions:
8976
12.0
9077
12.1
9178
12.2
92-
––– comment –––
93-
If new versions are detected, test will fail with detailed instructions:
94-
- Lists files that need to be updated in manticoresearch repo
95-
- Shows where to add new version tests
96-
- Reminds to update documentation in manual/
97-
- Reminds to update website in site repo (manticoresearch-grafana-integration blog post)
79+
––– input –––
80+
bash << 'SCRIPT'
81+
# Check blog post for Grafana version
82+
echo "Checking Grafana version in blog post..."
83+
echo ""
84+
85+
# Must match LATEST_TESTED_VERSION above
86+
GRAFANA_LATEST="12.2"
87+
88+
echo "=== Checking website blog post ==="
89+
BLOG_URL="https://manticoresearch.com/blog/manticoresearch-grafana-integration/"
90+
echo "✓ Fetching $BLOG_URL"
91+
92+
BLOG_CONTENT=$(curl -s "$BLOG_URL")
93+
94+
if [ -z "$BLOG_CONTENT" ]; then
95+
echo "⚠️ WARNING: Blog fetch failed - skipping" >&2
96+
elif echo "$BLOG_CONTENT" | grep -q "Grafana versions.*${GRAFANA_LATEST}"; then
97+
FOUND_FORMAT=$(echo "$BLOG_CONTENT" | grep -o "Grafana versions [0-9.-]*${GRAFANA_LATEST}" | head -1)
98+
echo "✅ Blog: $FOUND_FORMAT"
99+
else
100+
BLOG_VERSION=$(echo "$BLOG_CONTENT" | grep -o "Grafana versions [0-9.-]*" | head -1)
101+
echo "⚠️ WARNING: Blog does NOT contain ${GRAFANA_LATEST}" >&2
102+
echo " Found: $BLOG_VERSION" >&2
103+
echo " Expected: Grafana versions 10.0-${GRAFANA_LATEST}" >&2
104+
fi
105+
SCRIPT
106+
––– output –––
107+
Checking Grafana version in blog post...
108+
=== Checking website blog post ===
109+
✓ Fetching https://manticoresearch.com/blog/manticoresearch-grafana-integration/
110+
✅ Blog: Grafana versions 10.0-12.2

0 commit comments

Comments
 (0)