19 Commits
Author SHA1 Message Date
gitea-actions-bot 70258786fb ci: update test report [skip ci] 2026-11-21 13:07:43 +01:00
thischwaandJunie af04a484a1 docs: document pagination constructor parameters
Build and Analyse / build-and-analyse (push) Successful in 1m22s
Co-authored-by: Junie <junie@jetbrains.com>
2026-11-21 13:06:17 +01:00
gitea-actions-bot 4b1a32b1bf ci: update test report [skip ci] 2026-11-21 13:02:05 +01:00
thischwaandJunie 4c65cab3f6 ci: report build and test outcomes accurately
Build and Analyse / build-and-analyse (push) Successful in 1m37s
Co-authored-by: Junie <junie@jetbrains.com>
2026-11-21 13:00:28 +01:00
gitea-actions-bot 63713e30bd ci: update test report [skip ci] 2026-11-18 18:00:25 +01:00
thischwa ec32490cbf docs: add release badge to README
Build and Analyse / build-and-analyse (push) Successful in 1m42s
2026-11-18 17:58:18 +01:00
gitea-actions-bot fac92ed615 ci: update test report [skip ci] 2026-11-16 19:35:53 +01:00
gitea-actions-bot 5ed95453f1 ci: update test report [skip ci] 2026-11-16 19:34:16 +01:00
thischwa b563b16a26 [maven-release-plugin] prepare for next development iteration
Build and Analyse / build-and-analyse (push) Successful in 1m37s
2026-11-16 19:32:40 +01:00
thischwa e06aa67c24 [maven-release-plugin] prepare release v1.0.0
Build and Analyse / build-and-analyse (push) Successful in 1m37s
2026-11-16 19:32:38 +01:00
gitea-actions-bot 2031aa93e6 ci: update test report [skip ci] 2026-11-16 19:29:19 +01:00
thischwa 3f28774944 Merge remote-tracking branch 'origin/develop' into develop
Build and Analyse / build-and-analyse (push) Successful in 1m50s
2026-11-16 19:27:25 +01:00
thischwa 0ddc6b29ce Release 1.0.0
Bump version from 1.0.0-SNAPSHOT to 1.0.0 in changelog.
2026-11-16 19:27:19 +01:00
gitea-actions-bot b95d9bc5a0 ci: update test report [skip ci] 2026-11-14 14:30:20 +00:00
thischwa 980942fac5 .gitea/workflows/build-and-analyse.yml aktualisiert
Build and Analyse / build-and-analyse (push) Successful in 1m32s
2026-11-14 15:28:47 +01:00
gitea-actions-bot 6dd9a477e5 ci: update test report [skip ci] 2026-11-14 14:23:41 +00:00
gitea-actions-bot 50d8d385f7 ci: update test report [skip ci] 2026-11-09 17:36:34 +00:00
thischwaandJunie 9de0eaf850 docs: clarify base URL HTTPS requirements
Build and Analyse / build-and-analyse (push) Successful in 1m41s
Co-authored-by: Junie <junie@jetbrains.com>
2026-11-09 18:35:03 +01:00
gitea-actions-bot d09b5cb98b ci: update test report [skip ci] 2026-11-09 16:02:28 +00:00
9 changed files with 98 additions and 10 deletions

No files matched your search

+19 -2
View File
@@ -4,6 +4,9 @@ inputs:
token:
description: Gitea token with write access to the repository.
required: true
build-outcome:
description: Outcome of the build and test step.
required: true
runs:
using: composite
@@ -17,6 +20,7 @@ runs:
run: |
mkdir -p junit-short
shopt -s globstar nullglob
rm -f junit-short/*.xml
for f in **/target/*-reports/TEST-*.xml; do
base="$(basename "$f")"
short="${base#TEST-}"
@@ -25,10 +29,12 @@ runs:
- name: Generate Markdown Test Report
shell: bash
env:
BUILD_OUTCOME: ${{ inputs.build-outcome }}
run: |
mkdir -p reports
python3 - <<'EOF'
import glob, xml.etree.ElementTree as ET
import glob, os, xml.etree.ElementTree as ET
from datetime import datetime, timezone
generated_at = datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M:%S UTC")
@@ -57,7 +63,17 @@ runs:
test_rows.append(f"| {status} | {name} | {tests} | {passed} | {failures + errors} | {skipped} |")
total_passed = total_tests - total_failures - total_errors - total_skipped
overall = "✅ All tests passed" if (total_failures + total_errors) == 0 else "❌ Some tests failed"
build_outcome = os.environ.get("BUILD_OUTCOME", "unknown")
if total_failures + total_errors:
overall = "❌ Some tests failed"
elif not files:
overall = "⚠️ No JUnit reports found"
elif total_passed == 0:
overall = "⚠️ No tests passed"
elif build_outcome != "success":
overall = "❌ Build did not succeed"
else:
overall = "✅ All tests passed"
# --- JaCoCo ---
def counter(el, type_):
@@ -87,6 +103,7 @@ runs:
"# Test Report\n\n"
f"_Generated on {generated_at}_\n\n"
f"**{overall}**\n\n"
f"Build outcome: **{build_outcome}**\n\n"
"## Test Results\n\n"
"| | Tests | Passed | Failed | Skipped |\n"
"|---|---|---|---|---|\n"
+57
View File
@@ -0,0 +1,57 @@
import os
import pathlib
import subprocess
import tempfile
import unittest
ACTION = pathlib.Path(__file__).resolve().parents[1] / "actions/publish-report/action.yml"
def generate_report(directory, outcome, xml=None):
action = ACTION.read_text()
script = action.split(" python3 - <<'EOF'\n", 1)[1].split(" EOF", 1)[0]
script = "\n".join(line[8:] for line in script.splitlines())
root = pathlib.Path(directory)
(root / "reports").mkdir()
(root / "junit-short").mkdir()
if xml is not None:
(root / "junit-short/test.xml").write_text(xml)
env = dict(os.environ, BUILD_OUTCOME=outcome)
subprocess.run(["python3", "-c", script], cwd=root, env=env, check=True, capture_output=True)
return (root / "reports/test.md").read_text()
class PublishReportTest(unittest.TestCase):
def test_missing_reports_are_not_successful(self):
with tempfile.TemporaryDirectory() as directory:
report = generate_report(directory, "failure")
self.assertNotIn("All tests passed", report)
self.assertIn("No JUnit", report)
self.assertIn("failure", report)
def test_failed_build_with_passing_tests_is_not_successful(self):
with tempfile.TemporaryDirectory() as directory:
report = generate_report(directory, "failure", '<testsuite name="example" tests="1" failures="0" errors="0" skipped="0"/>')
self.assertNotIn("All tests passed", report)
self.assertIn("failure", report)
def test_passing_build_and_tests(self):
with tempfile.TemporaryDirectory() as directory:
report = generate_report(directory, "success", '<testsuite name="example" tests="1" failures="0" errors="0" skipped="0"/>')
self.assertIn("All tests passed", report)
def test_all_skipped_is_not_successful(self):
with tempfile.TemporaryDirectory() as directory:
report = generate_report(directory, "success", '<testsuite name="example" tests="1" failures="0" errors="0" skipped="1"/>')
self.assertNotIn("All tests passed", report)
def test_failed_tests(self):
with tempfile.TemporaryDirectory() as directory:
report = generate_report(directory, "failure", '<testsuite name="example" tests="1" failures="1" errors="0" skipped="0"/>')
self.assertNotIn("All tests passed", report)
self.assertIn("Some tests failed", report)
if __name__ == "__main__":
unittest.main()
+4 -1
View File
@@ -7,6 +7,7 @@ on:
- 'feature/**'
pull_request:
types: [ opened, synchronize, reopened ]
workflow_dispatch:
defaults:
run:
@@ -25,13 +26,15 @@ jobs:
uses: ./.gitea/actions/setup-java-maven
- name: Build and test
id: build
env:
# required by the live tests (CfClientTest, CfClientPenTest), they are skipped if not set
API_TOKEN: ${{ secrets.API_TOKEN }}
run: mvn -B verify
run: mvn -B clean verify
- name: Publish Test Report
uses: ./.gitea/actions/publish-report
if: ${{ always() }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
build-outcome: ${{ steps.build.outcome }}
+2
View File
@@ -2,6 +2,8 @@
[![Build and Analyse](https://git.mein-gateway.de/thischwa/CloudflareDNS-java/actions/workflows/build-and-analyse.yml/badge.svg?branch=develop)](https://git.mein-gateway.de/thischwa/CloudflareDNS-java/actions?workflow=build-and-analyse.yml)
[![release](https://img.shields.io/maven-metadata/v?metadataUrl=https%3A%2F%2Fgit.mein-gateway.de%2Fapi%2Fpackages%2Fthischwa%2Fmaven%2Fcodes%2Fthischwa%2Fcloudflaredns%2Fmaven-metadata.xml)](https://git.mein-gateway.de/thischwa/-/packages/maven/codes.thischwa:cloudflaredns/)
[Test report](reports/test.md)
## Preface
+1 -1
View File
@@ -1,6 +1,6 @@
# Changelog
- 1.0.0-SNAPSHOT:
- 1.0.0:
- **Breaking Changes**:
- `recordList` overloads replaced, because they were ambiguous (e.g. `recordList(zone, null)` didn't compile):
- `recordList(zone, String subdomain, RecordType... types)` and `recordList(zone, String subdomain)` → `recordListBySubdomain(zone, subdomain, types...)`
+1 -1
View File
@@ -4,7 +4,7 @@
<groupId>codes.thischwa</groupId>
<artifactId>cloudflaredns</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>1.1.0-SNAPSHOT</version>
<name>CloudflareDNS-java</name>
<inceptionYear>2025</inceptionYear>
<packaging>jar</packaging>
+3 -1
View File
@@ -1,9 +1,11 @@
# Test Report
_Generated on 2026-11-09 15:57:46 UTC_
_Generated on 2026-11-21 12:07:43 UTC_
**✅ All tests passed**
Build outcome: **success**
## Test Results
| | Tests | Passed | Failed | Skipped |
@@ -56,13 +56,14 @@ public class CfDnsClientBuilder {
* Sets the base URL to be used by the {@code CfDnsClient}.
* This method allows configuring the base URL for API requests, overriding any default value.
*
* <p>To protect the credentials, only HTTPS URLs for {@code api.cloudflare.com} are accepted.
* <p>Only HTTPS URLs with a host are accepted. User information, query parameters and fragments
* are not permitted. Credentials are sent to the configured host, so only use trusted URLs.
*
* @param baseUrl the base URL to be used for API requests, {@code null} resets it to
* {@link #DEFAULT_BASEURL}
* @return the current instance of {@code CfDnsClientBuilder}, enabling method chaining
* @throws IllegalArgumentException if the URL is invalid, doesn't use HTTPS or doesn't target
* {@code api.cloudflare.com}
* @throws IllegalArgumentException if the URL is invalid, doesn't use HTTPS, has no host or
* contains user information, a query or a fragment
*/
public CfDnsClientBuilder withBaseUrl(@Nullable String baseUrl) {
this.baseUrl = baseUrl == null ? null : validateBaseUrl(baseUrl);
@@ -27,7 +27,13 @@ public record PagingRequest(int page, int perPage) {
/** Maximum number of zones allowed per page by Cloudflare. */
public static final int MAX_ZONES_PER_PAGE = 50;
/** Validates the page number and page size. */
/**
* Validates the page number and page size.
*
* @param page the 1-based page number
* @param perPage the number of items per page, from 1 to {@value #MAX_RECORDS_PER_PAGE}
* @throws IllegalArgumentException if either value is outside its allowed range
*/
public PagingRequest {
if (page < 1) {
throw new IllegalArgumentException("page must be at least 1, but was " + page);