feat: add Prom remote-write query regression scenario (#8413)

* feat: add Prom remote-write query regression scenario

Signed-off-by: discord9 <discord9@163.com>

* test: add high-cardinality remote-write query case

Signed-off-by: discord9 <discord9@163.com>

* feat: chunk remote-write query regression loads

Signed-off-by: discord9 <discord9@163.com>

* test: use multi-day remote-write regression case

Signed-off-by: discord9 <discord9@163.com>

* fix: address query regression review comments

Signed-off-by: discord9 <discord9@163.com>

* ci: allow large query regression comments

Signed-off-by: discord9 <discord9@163.com>

---------

Signed-off-by: discord9 <discord9@163.com>
This commit is contained in:
discord9
2026-07-07 15:58:56 +08:00
committed by GitHub
parent 8f5d681e4b
commit 12f83828b1
13 changed files with 791 additions and 75 deletions

View File

@@ -49,7 +49,7 @@ function text(value) {
.replace(/@/g, '@\u200b')
.replace(/\|/g, '\\|')
.replace(/\r?\n/g, ' ');
return result.length > 512 ? `${result.slice(0, 509)}...` : result;
return result;
}
function statusEmoji(status) {
@@ -251,10 +251,6 @@ module.exports = async function validateQueryRegressionComment({ github, context
} else {
const rendered = [];
for (const reportPath of reportPaths) {
const size = fs.statSync(reportPath).size;
if (size > 1024 * 1024) {
return skip(core, `Report file too large: ${reportPath} (${size} bytes).`);
}
let report;
try {
report = JSON.parse(fs.readFileSync(reportPath, 'utf8'));
@@ -266,9 +262,6 @@ module.exports = async function validateQueryRegressionComment({ github, context
body += rendered.join('\n\n---\n\n') + '\n';
}
if (body.length > 59999) {
body = `${body.slice(0, 59500)}\n\n\n\n_Comment truncated because it exceeded 60000 characters._\n`;
}
fs.writeFileSync(summaryPath, body);
core.setOutput('should_post', 'true');

View File

@@ -106,6 +106,8 @@ def run_case(args: argparse.Namespace, case_path: Path, work_dir: Path) -> int:
str(candidate_bin),
"--fixture-generator",
str(fixture_generator),
"--remote-write-generator",
str(args.remote_write_generator),
"--work-dir",
str(work_dir),
"--http-timeout",
@@ -158,6 +160,11 @@ def main() -> int:
parser.add_argument("--work-dir", default=Path("query-regression-work"), type=Path)
parser.add_argument("--http-timeout", default=os.environ.get("HTTP_TIMEOUT", "300"))
parser.add_argument("--allow-large-fixture", default=os.environ.get("ALLOW_LARGE_FIXTURE", "false"))
parser.add_argument(
"--remote-write-generator",
type=Path,
default=configured_path(os.environ.get("REMOTE_WRITE_GENERATOR")),
)
parser.add_argument(
"--summary-script",
type=Path,
@@ -170,6 +177,8 @@ def main() -> int:
parser.add_argument("--candidate-ref", default=os.environ.get("CANDIDATE_REF", ""))
parser.add_argument("--github-output", default=os.environ.get("GITHUB_OUTPUT"))
args = parser.parse_args()
if args.remote_write_generator is None:
args.remote_write_generator = args.candidate_src / "target" / profile_dir(args.cargo_profile) / "prom_remote_write_fixture"
try:
cases = split_cases(args.cases or [os.environ.get("CASE_PATHS", "all")])

View File

@@ -46,12 +46,6 @@ jobs:
core.setOutput('found', 'false');
return;
}
const maxBytes = 1024 * 1024;
if (artifact.size_in_bytes > maxBytes) {
core.warning(`Comment artifact too large: ${artifact.size_in_bytes} bytes`);
core.setOutput('found', 'false');
return;
}
core.setOutput('found', 'true');
core.setOutput('id', String(artifact.id));

View File

@@ -119,10 +119,10 @@ jobs:
git reset --hard FETCH_HEAD
git clean -ffdx
- name: Build candidate greptime and fixture generator
- name: Build candidate greptime and fixture generators
working-directory: src
run: |
cargo build --profile "${CARGO_PROFILE}" -p cmd --bin greptime --bin query_perf_fixture
cargo build --profile "${CARGO_PROFILE}" -p cmd --bin greptime --bin query_perf_fixture --bin prom_remote_write_fixture
target_dir="${CARGO_PROFILE}"
if [[ "${CARGO_PROFILE}" == "dev" ]]; then
target_dir="debug"
@@ -132,6 +132,8 @@ jobs:
"${GITHUB_WORKSPACE}/query-regression-bins/candidate/greptime"
cp "${CARGO_TARGET_DIR}/${target_dir}/query_perf_fixture" \
"${GITHUB_WORKSPACE}/query-regression-bins/candidate/query_perf_fixture"
cp "${CARGO_TARGET_DIR}/${target_dir}/prom_remote_write_fixture" \
"${GITHUB_WORKSPACE}/query-regression-bins/candidate/prom_remote_write_fixture"
- name: Run query regression
id: run
@@ -144,6 +146,7 @@ jobs:
BASE_BIN: ${{ github.workspace }}/query-regression-bins/base/greptime
CANDIDATE_BIN: ${{ github.workspace }}/query-regression-bins/candidate/greptime
FIXTURE_GENERATOR: ${{ github.workspace }}/query-regression-bins/candidate/query_perf_fixture
REMOTE_WRITE_GENERATOR: ${{ github.workspace }}/query-regression-bins/candidate/prom_remote_write_fixture
run: >-
uv run --no-project python src/.github/scripts/query-regression-run.py
--base-src src