Skip to content

Commit

Permalink
include string test_id in analysis matviews
Browse files Browse the repository at this point in the history
  • Loading branch information
sosiouxme committed Jul 28, 2024
1 parent c969e6c commit c9b4659
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/db/matviews.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ GROUP BY
const testAnalysisByVariantMatView = `
SELECT
tests.id AS test_id,
town.unique_id as test_str_id,
tests.name AS test_name,
tests.watchlist,
date(prow_job_runs."timestamp") AS date,
Expand All @@ -254,17 +255,19 @@ SELECT
FROM
prow_job_run_tests
JOIN tests ON tests.id = prow_job_run_tests.test_id
JOIN test_ownerships town ON town.test_id = tests.id
JOIN prow_job_runs ON prow_job_runs.id = prow_job_run_tests.prow_job_run_id
JOIN prow_jobs ON prow_jobs.id = prow_job_runs.prow_job_id
WHERE
prow_job_run_tests.created_at > (|||TIMENOW||| - '14 days'::interval) AND prow_job_runs."timestamp" > (|||TIMENOW||| - '14 days'::interval)
GROUP BY
tests.name, tests.id, date(prow_job_runs."timestamp"), unnest(prow_jobs.variants), prow_jobs.release
tests.name, town.unique_id, tests.id, date(prow_job_runs."timestamp"), unnest(prow_jobs.variants), prow_jobs.release
`

const testAnalysisByJobMatView = `
SELECT
tests.id AS test_id,
town.unique_id as test_str_id,
tests.name AS test_name,
tests.watchlist,
date(prow_job_runs."timestamp") AS date,
Expand All @@ -277,12 +280,13 @@ SELECT
FROM
prow_job_run_tests
JOIN tests ON tests.id = prow_job_run_tests.test_id
JOIN test_ownerships town ON town.test_id = tests.id
JOIN prow_job_runs ON prow_job_runs.id = prow_job_run_tests.prow_job_run_id
JOIN prow_jobs ON prow_jobs.id = prow_job_runs.prow_job_id
WHERE
prow_job_run_tests.created_at > (|||TIMENOW||| - '14 days'::interval) AND prow_job_runs."timestamp" > (|||TIMENOW||| - '14 days'::interval)
GROUP BY
tests.name, tests.id, date(prow_job_runs."timestamp"), prow_jobs.release, prow_jobs.name
tests.name, town.unique_id, tests.id, date(prow_job_runs."timestamp"), prow_jobs.release, prow_jobs.name
`

const prowJobFailedTestsMatView = `
Expand Down

0 comments on commit c9b4659

Please sign in to comment.