This commit is contained in:
wcbeard 2020-07-09 09:45:26 -04:00
Родитель f2da3f8c9f
Коммит 6e15d70cce
4 изменённых файлов: 29 добавлений и 11 удалений

1
.gitignore поставляемый
Просмотреть файл

@ -1,3 +1,2 @@
default.profraw default.profraw
stash/ stash/

Просмотреть файл

@ -23,13 +23,13 @@ def subdate_diff(subdate, **diff_kw):
@click.option("--start_date", default=None) @click.option("--start_date", default=None)
@click.option("--end_date", default=None) @click.option("--end_date", default=None)
def fmt_test_data_query( def fmt_test_data_query(
fill_yesterday=True, fill_yesterday=False,
backfill=False, backfill=False,
end_date=None, end_date=None,
bh_start_date=None, bh_start_date=None,
start_date=None, start_date=None,
): ):
if not backfill or fill_yesterday or start_date: if not (backfill or fill_yesterday or start_date):
raise ValueError( raise ValueError(
"At least specify `backfill` or `fill_yesterday`" "At least specify `backfill` or `fill_yesterday`"
) )

Просмотреть файл

@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -o xtrace
DEST_PROJ="moz-fx-data-bq-data-science"
DEST_TABLE="$DEST_PROJ:wbeard.test_slow_regression_test_data"
python gen_test_data_query.py \
--fill_yesterday=True | \
bq query --use_legacy_sql=false \
--destination_table="$DEST_TABLE" \
--replace=true \
--project_id=moz-fx-data-derived-datasets

Просмотреть файл

@ -1,6 +1,3 @@
DECLARE BH_START_DATE, START_DATE, END_DATE date;
SET (BH_START_DATE, START_DATE, END_DATE) = ('{BH_START_DATE}', '{START_DATE}', '{END_DATE}');
-- SET (BH_START_DATE, START_DATE, END_DATE) = ('2019-06-01', '2019-06-01', CURRENT_DATE());
/* /*
- deduped test version - deduped test version
@ -16,6 +13,15 @@ Common frameworks: 'job_resource_usage', 'vcs', 'build_metrics',
'browsertime', 'devtools', 'js-bench' 'browsertime', 'devtools', 'js-bench'
*/ */
CREATE TEMP FUNCTION bh_start_date() returns date AS (
'{BH_START_DATE}'
);
CREATE TEMP FUNCTION major_vers(st string) AS (
-- '10.0' => 10
cast(regexp_extract(st, '(\\d+)\\.?') as int64)
);
-- Talos tests that measure release criteria -- Talos tests that measure release criteria
CREATE TEMP FUNCTION isDesiredTalos(name STRING) AS ( CREATE TEMP FUNCTION isDesiredTalos(name STRING) AS (
name IN ('tabpaint', 'tabswitch', 'startup_about_home_paint', 'sessionrestore') name IN ('tabpaint', 'tabswitch', 'startup_about_home_paint', 'sessionrestore')
@ -104,7 +110,7 @@ with bh_base as
and b.build.target.os = 'win' and b.build.target.os = 'win'
and b.build.target.locale = 'en-US' and b.build.target.locale = 'en-US'
and build.source.product = 'firefox' and build.source.product = 'firefox'
and date(build.build.date) >= START_DATE and date(build.build.date) >= bh_start_date() -- START_DATE
-- don't want dot-versions, like 72.0.2 -- don't want dot-versions, like 72.0.2
and ndots(build.target.version) < 2 and ndots(build.target.version) < 2
) )
@ -126,7 +132,7 @@ gbv1 as
, gbv as ( , gbv as (
select select
g1.*, g1.*,
coalesce(next_release_date, END_DATE) as next_release_date coalesce(next_release_date, '{END_DATE}') as next_release_date
from gbv1 g1 from gbv1 g1
left join ( left join (
select select
@ -145,7 +151,7 @@ left join (
nth_version desc) as vers_ord, nth_version desc) as vers_ord,
from (select day from (select day
from from
unnest( GENERATE_DATE_ARRAY(BH_START_DATE, END_DATE, interval 1 day) ) as day unnest( GENERATE_DATE_ARRAY(bh_start_date(), '{END_DATE}', interval 1 day) ) as day
) )
days cross join gbv days cross join gbv
where where
@ -224,14 +230,15 @@ left join (
) as def on def.taskId = perf.taskId ) as def on def.taskId = perf.taskId
WHERE WHERE
date(perf.time) > "2019-07-01" -- min date of db date(perf.time) > "2019-07-01" -- min date of db
and date(perf.time) between START_DATE and END_DATE and date(perf.time) between '{START_DATE}' and '{END_DATE}'
and isReleaseCriteria_notime(perf.framework, project, perf.platform, s.name) and isReleaseCriteria_notime(perf.framework, project, perf.platform, s.name)
) )
select select
b.*, b.*,
vers.version as bvers vers.version as bvers,
major_vers(vers.version) as mvers
from base b from base b
left join day_vers vers left join day_vers vers
on date(b.time) = vers.day on date(b.time) = vers.day