id int64 0 1.29M | original_id stringlengths 32 32 | swhid stringlengths 100 170 | sha1 stringlengths 40 40 | repo_name stringlengths 2 45 | repo_group stringclasses 12
values | filepath stringlengths 5 153 | name stringlengths 1 14.9k | type stringclasses 3
values | code stringlengths 7 2.12M |
|---|---|---|---|---|---|---|---|---|---|
400 | 0b68189761120d9873b688ee0c3e009b | swh:1:cnt:7c26506bf76c066e8463b3530f2dd0b010e92503;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=131-142/ | d8bd28caa96a8b4ab647d9ec4d5a7252ecb8aff9 | aggregator | analytics | tests/test_projectcounts/test_monitoring.py | MonitoringTestCase::test_validity_no_enwiki(self) | function | def test_validity_no_enwiki(self):
self.create_valid_aggregated_projects()
enwiki_file_abs = os.path.join(self.csv_dir_abs, 'enwiki.csv')
os.unlink(enwiki_file_abs)
issues = aggregator.get_validity_issues_for_aggregated_projectcounts(
self.data_dir_abs)
# At least ... |
401 | 63439ae116c0ba35ccd2b8ead68c421f | swh:1:cnt:7c26506bf76c066e8463b3530f2dd0b010e92503;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=288-290/ | d8bd28caa96a8b4ab647d9ec4d5a7252ecb8aff9 | aggregator | analytics | tests/test_projectcounts/test_monitoring.py | MonthlyMonitoringTestCase::setUp(self) | function | def setUp(self):
super(MonthlyMonitoringTestCase, self).setUp()
self.csv_dir_abs = self.monthly_dir_abs |
402 | 24d4d265385637189155509f9b88e57b | swh:1:cnt:7c26506bf76c066e8463b3530f2dd0b010e92503;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=123-129/ | d8bd28caa96a8b4ab647d9ec4d5a7252ecb8aff9 | aggregator | analytics | tests/test_projectcounts/test_monitoring.py | MonitoringTestCase::test_validity_no_csvs(self) | function | def test_validity_no_csvs(self):
issues = aggregator.get_validity_issues_for_aggregated_projectcounts(
self.data_dir_abs)
# At least one issue, as no csvs could get found
nose.tools.assert_greater_equal(len(issues), 1)
self.assert_has_item_by_re(issues, 'not find any CSVs') |
403 | c99ee5b46b5f8ee8a7984c0af1c6f0f7 | swh:1:cnt:7c26506bf76c066e8463b3530f2dd0b010e92503;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=144-156/ | d8bd28caa96a8b4ab647d9ec4d5a7252ecb8aff9 | aggregator | analytics | tests/test_projectcounts/test_monitoring.py | MonitoringTestCase::test_validity_only_big_wikis(self) | function | def test_validity_only_big_wikis(self):
self.create_valid_aggregated_projects()
foo_file_abs = os.path.join(self.csv_dir_abs, 'foo.csv')
os.unlink(foo_file_abs)
issues = aggregator.get_validity_issues_for_aggregated_projectcounts(
self.data_dir_abs)
# At least one ... |
404 | 7c1ebddedcf037b266fe3d25e03a8596 | swh:1:cnt:7c26506bf76c066e8463b3530f2dd0b010e92503;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=292-294/ | d8bd28caa96a8b4ab647d9ec4d5a7252ecb8aff9 | aggregator | analytics | tests/test_projectcounts/test_monitoring.py | MonthlyMonitoringTestCase::get_relevant_date_strs(self) | function | def get_relevant_date_strs(self):
for date_str in self.get_relevant_monthly_date_strs():
yield date_str |
405 | 35f55a1b7649384da0fa32f445c92d23 | swh:1:cnt:346e5f5dc740aca71ee422db7f4024c4d3cbe6f5;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=30-319/ | 8909affbd410371dccdafe8c458fae2c14f303f1 | aggregator | analytics | tests/test_projectcounts/test_monthly_aggregation.py | MonthlyProjectAggregationTestCase | type | class MonthlyProjectAggregationTestCase(testcases.ProjectcountsDataTestCase):
"""TestCase for 'monthly' project aggregation functions"""
def test_monthly_csv_non_existing_csv_31_day_month(self):
enwiki_file_abs = os.path.join(self.monthly_dir_abs, 'enwiki.csv')
first_date = datetime.date(2014, ... |
406 | cd0b82a57e6b50f91e6ef555adcda095 | swh:1:cnt:346e5f5dc740aca71ee422db7f4024c4d3cbe6f5;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=74-93/ | 8909affbd410371dccdafe8c458fae2c14f303f1 | aggregator | analytics | tests/test_projectcounts/test_monthly_aggregation.py | MonthlyProjectAggregationTestCase::test_monthly_csv_non_existing_csv_29_day_month(self) | function | def test_monthly_csv_non_existing_csv_29_day_month(self):
enwiki_file_abs = os.path.join(self.monthly_dir_abs, 'enwiki.csv')
first_date = datetime.date(2012, 2, 20)
last_date = datetime.date(2012, 2, 29)
csv_data = {
'2012-01-31': '2012-01-31,1,2,3,4',
'2012-03-... |
407 | 6f48e2cd4016f1e2a55252250817eaa9 | swh:1:cnt:346e5f5dc740aca71ee422db7f4024c4d3cbe6f5;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=116-142/ | 8909affbd410371dccdafe8c458fae2c14f303f1 | aggregator | analytics | tests/test_projectcounts/test_monthly_aggregation.py | MonthlyProjectAggregationTestCase::test_monthly_csv_existing_csv_existing_month(self) | function | def test_monthly_csv_existing_csv_existing_month(self):
enwiki_file_abs = os.path.join(self.monthly_dir_abs, 'enwiki.csv')
self.create_file(enwiki_file_abs, [
'2014-06,1,2,3,4',
'2014-07,4,5,6,7',
'2014-08,8,9,10,11',
])
first_date = datetime.date... |
408 | 0801e39b5e640a87f958ae80c3495125 | swh:1:cnt:346e5f5dc740aca71ee422db7f4024c4d3cbe6f5;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=173-204/ | 8909affbd410371dccdafe8c458fae2c14f303f1 | aggregator | analytics | tests/test_projectcounts/test_monthly_aggregation.py | MonthlyProjectAggregationTestCase::test_monthly_csv_existing_csv_bad_dates_existing_month(self) | function | def test_monthly_csv_existing_csv_bad_dates_existing_month(self):
enwiki_file_abs = os.path.join(self.monthly_dir_abs, 'enwiki.csv')
self.create_file(enwiki_file_abs, [
'2014-06,1,2,3,4',
'2014-07,4,5,6,7',
'2014-08,8,9,10,11',
])
first_date = dat... |
409 | 16769a3a7ff87350032a455e0908a5f6 | swh:1:cnt:346e5f5dc740aca71ee422db7f4024c4d3cbe6f5;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=240-266/ | 8909affbd410371dccdafe8c458fae2c14f303f1 | aggregator | analytics | tests/test_projectcounts/test_monthly_aggregation.py | MonthlyProjectAggregationTestCase::test_monthly_csv_existing_csv_only_bad_dates_no_existing_data(self) | function | def test_monthly_csv_existing_csv_only_bad_dates_no_existing_data(self):
enwiki_file_abs = os.path.join(self.monthly_dir_abs, 'enwiki.csv')
self.create_file(enwiki_file_abs, [
'2014-06,1,2,3,4',
'2014-08,8,9,10,11',
])
first_date = datetime.date(2014, 7, 20)
... |
410 | b30670d4160a93da9b221bed7179a672 | swh:1:cnt:346e5f5dc740aca71ee422db7f4024c4d3cbe6f5;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=32-51/ | 8909affbd410371dccdafe8c458fae2c14f303f1 | aggregator | analytics | tests/test_projectcounts/test_monthly_aggregation.py | MonthlyProjectAggregationTestCase::test_monthly_csv_non_existing_csv_31_day_month(self) | function | def test_monthly_csv_non_existing_csv_31_day_month(self):
enwiki_file_abs = os.path.join(self.monthly_dir_abs, 'enwiki.csv')
first_date = datetime.date(2014, 7, 20)
last_date = datetime.date(2014, 7, 31)
csv_data = {
'2014-06-30': '2014-06-30,1,2,3,4',
'2014-08-... |
411 | 03b9047990e7d755430a2403df22ad01 | swh:1:cnt:346e5f5dc740aca71ee422db7f4024c4d3cbe6f5;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=95-114/ | 8909affbd410371dccdafe8c458fae2c14f303f1 | aggregator | analytics | tests/test_projectcounts/test_monthly_aggregation.py | MonthlyProjectAggregationTestCase::test_monthly_csv_non_existing_csv_28_day_month(self) | function | def test_monthly_csv_non_existing_csv_28_day_month(self):
enwiki_file_abs = os.path.join(self.monthly_dir_abs, 'enwiki.csv')
first_date = datetime.date(2014, 2, 20)
last_date = datetime.date(2014, 2, 28)
csv_data = {
'2014-01-31': '2014-01-31,1,2,3,4',
'2014-03-... |
412 | 83f62f0c3f1be18ab3b2b6d3b3dcef46 | swh:1:cnt:346e5f5dc740aca71ee422db7f4024c4d3cbe6f5;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=53-72/ | 8909affbd410371dccdafe8c458fae2c14f303f1 | aggregator | analytics | tests/test_projectcounts/test_monthly_aggregation.py | MonthlyProjectAggregationTestCase::test_monthly_csv_non_existing_csv_30_day_month(self) | function | def test_monthly_csv_non_existing_csv_30_day_month(self):
enwiki_file_abs = os.path.join(self.monthly_dir_abs, 'enwiki.csv')
first_date = datetime.date(2014, 6, 20)
last_date = datetime.date(2014, 6, 30)
csv_data = {
'2014-05-31': '2014-05-31,1,2,3,4',
'2014-07-... |
413 | 4dedf9cb391b23d9b32aa86143121733 | swh:1:cnt:346e5f5dc740aca71ee422db7f4024c4d3cbe6f5;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=144-171/ | 8909affbd410371dccdafe8c458fae2c14f303f1 | aggregator | analytics | tests/test_projectcounts/test_monthly_aggregation.py | MonthlyProjectAggregationTestCase::test_monthly_csv_existing_csv_existing_month_force(self) | function | def test_monthly_csv_existing_csv_existing_month_force(self):
enwiki_file_abs = os.path.join(self.monthly_dir_abs, 'enwiki.csv')
self.create_file(enwiki_file_abs, [
'2014-06,1,2,3,4',
'2014-07,4,5,6,7',
'2014-08,8,9,10,11',
])
first_date = datetim... |
414 | d4e872223c61a9b468412552978a700f | swh:1:cnt:346e5f5dc740aca71ee422db7f4024c4d3cbe6f5;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=206-238/ | 8909affbd410371dccdafe8c458fae2c14f303f1 | aggregator | analytics | tests/test_projectcounts/test_monthly_aggregation.py | MonthlyProjectAggregationTestCase::test_monthly_csv_existing_csv_bad_last_day(self) | function | def test_monthly_csv_existing_csv_bad_last_day(self):
enwiki_file_abs = os.path.join(self.monthly_dir_abs, 'enwiki.csv')
self.create_file(enwiki_file_abs, [
'2014-06,1,2,3,4',
'2014-07,4,5,6,7',
'2014-08,8,9,10,11',
])
first_date = datetime.date(2... |
415 | 380696501953e20f1e0ce2eae7c0af34 | swh:1:cnt:346e5f5dc740aca71ee422db7f4024c4d3cbe6f5;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=268-295/ | 8909affbd410371dccdafe8c458fae2c14f303f1 | aggregator | analytics | tests/test_projectcounts/test_monthly_aggregation.py | MonthlyProjectAggregationTestCase::test_monthly_csv_existing_csv_only_bad_dates_existing_data(self) | function | def test_monthly_csv_existing_csv_only_bad_dates_existing_data(self):
enwiki_file_abs = os.path.join(self.monthly_dir_abs, 'enwiki.csv')
self.create_file(enwiki_file_abs, [
'2014-06,1,2,3,4',
'2014-07,4,5,6,7',
'2014-08,8,9,10,11',
])
first_date =... |
416 | 871ed902d575619f5e2218106af6146f | swh:1:cnt:346e5f5dc740aca71ee422db7f4024c4d3cbe6f5;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=297-319/ | 8909affbd410371dccdafe8c458fae2c14f303f1 | aggregator | analytics | tests/test_projectcounts/test_monthly_aggregation.py | MonthlyProjectAggregationTestCase::test_monthly_csv_zero_and_missing_data(self) | function | def test_monthly_csv_zero_and_missing_data(self):
enwiki_file_abs = os.path.join(self.monthly_dir_abs, 'enwiki.csv')
first_date = datetime.date(2014, 7, 20)
last_date = datetime.date(2014, 7, 31)
csv_data = {
'2014-06-30': '2014-06-30,1,2,3,4',
'2014-08-01': '20... |
417 | b760f33990b3b912c4bf3ebbed8b721d | swh:1:cnt:24d613005841dfc5513baba5b40a8e29616547b1;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=31-458/ | 870780f1c05b613bd7044e8bb60ff1118ace8d2f | aggregator | analytics | tests/test_projectcounts/test_per_project_aggregation.py | ProjectAggregationTestCase | type | class ProjectAggregationTestCase(testcases.ProjectcountsDataTestCase):
"""TestCase for project aggregation functions"""
def test_update_per_project_no_csvs(self):
fixture = self.get_fixture_dir_abs('2014-11-missing-hours')
date = datetime.date(2014, 11, 1)
aggregator.update_per_project... |
418 | cd4194f6ec0ba18ef4d95715f92cfea1 | swh:1:cnt:24d613005841dfc5513baba5b40a8e29616547b1;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=352-357/ | 870780f1c05b613bd7044e8bb60ff1118ace8d2f | aggregator | analytics | tests/test_projectcounts/test_per_project_aggregation.py | ProjectAggregationTestCase::test_update_per_project_additional_aggregators_using_projectview::funcMock(target_dir_abs, dbname, csv_data_input, first_date,
last_date, bad_dates, force_recomputation) | function | def funcMock(target_dir_abs, dbname, csv_data_input, first_date,
last_date, bad_dates, force_recomputation):
funcMockParams.append([
target_dir_abs, dbname, csv_data_input, first_date, last_date,
bad_dates, force_recomputation
]) |
419 | e6c6fb1eab037392703ce05e3ea637a7 | swh:1:cnt:24d613005841dfc5513baba5b40a8e29616547b1;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=419-458/ | 870780f1c05b613bd7044e8bb60ff1118ace8d2f | aggregator | analytics | tests/test_projectcounts/test_per_project_aggregation.py | ProjectAggregationTestCase::test_update_per_project_compute_all_projects_outside_range(self) | function | def test_update_per_project_compute_all_projects_outside_range(self):
fixture = self.get_fixture_dir_abs(
'2014-11-3projects-for-aggregation')
# ask to just compute day 3
first_date = datetime.date(2014, 11, 3)
last_date = datetime.date(2014, 11, 3)
enwiki_file_abs ... |
420 | eeb719e4d08d127267df938705e17cf0 | swh:1:cnt:24d613005841dfc5513baba5b40a8e29616547b1;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=78-95/ | 870780f1c05b613bd7044e8bb60ff1118ace8d2f | aggregator | analytics | tests/test_projectcounts/test_per_project_aggregation.py | ProjectAggregationTestCase::test_update_per_project_single_csvs_3days_2014_11_01(self) | function | def test_update_per_project_single_csvs_3days_2014_11_01(self):
fixture = self.get_fixture_dir_abs(
'2014-11-3days-enwiki-day-times-100-plus-hour')
date = datetime.date(2014, 11, 1)
enwiki_file_abs = os.path.join(self.daily_raw_dir_abs, 'enwiki.csv')
self.create_empty_file(... |
421 | cdeadf82c153f7ede5b9c723f3f9ade3 | swh:1:cnt:24d613005841dfc5513baba5b40a8e29616547b1;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=116-133/ | 870780f1c05b613bd7044e8bb60ff1118ace8d2f | aggregator | analytics | tests/test_projectcounts/test_per_project_aggregation.py | ProjectAggregationTestCase::test_update_per_project_single_csvs_3days_2014_11_03(self) | function | def test_update_per_project_single_csvs_3days_2014_11_03(self):
fixture = self.get_fixture_dir_abs(
'2014-11-3days-enwiki-day-times-100-plus-hour')
date = datetime.date(2014, 11, 3)
enwiki_file_abs = os.path.join(self.daily_raw_dir_abs, 'enwiki.csv')
self.create_empty_file(... |
422 | 03bb95576b66899a579163c289bddc8e | swh:1:cnt:24d613005841dfc5513baba5b40a8e29616547b1;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=201-221/ | 870780f1c05b613bd7044e8bb60ff1118ace8d2f | aggregator | analytics | tests/test_projectcounts/test_per_project_aggregation.py | ProjectAggregationTestCase::test_update_daily_forced_recomputation(self) | function | def test_update_daily_forced_recomputation(self):
fixture = self.get_fixture_dir_abs(
'2014-11-3days-enwiki-day-times-100-plus-hour')
date = datetime.date(2014, 11, 1)
enwiki_file_abs = os.path.join(self.daily_raw_dir_abs, 'enwiki.csv')
self.create_file(enwiki_file_abs, [
... |
423 | cd4194f6ec0ba18ef4d95715f92cfea1 | swh:1:cnt:24d613005841dfc5513baba5b40a8e29616547b1;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=300-305/ | 870780f1c05b613bd7044e8bb60ff1118ace8d2f | aggregator | analytics | tests/test_projectcounts/test_per_project_aggregation.py | ProjectAggregationTestCase::test_update_per_project_additional_aggregators_with_parameters::funcMock(target_dir_abs, dbname, csv_data_input, first_date,
last_date, bad_dates, force_recomputation) | function | def funcMock(target_dir_abs, dbname, csv_data_input, first_date,
last_date, bad_dates, force_recomputation):
funcMockParams.append([
target_dir_abs, dbname, csv_data_input, first_date, last_date,
bad_dates, force_recomputation
]) |
424 | fbd95ccd35887d2282ad0e5539b1ed03 | swh:1:cnt:24d613005841dfc5513baba5b40a8e29616547b1;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=97-114/ | 870780f1c05b613bd7044e8bb60ff1118ace8d2f | aggregator | analytics | tests/test_projectcounts/test_per_project_aggregation.py | ProjectAggregationTestCase::test_update_per_project_single_csvs_3days_2014_11_02(self) | function | def test_update_per_project_single_csvs_3days_2014_11_02(self):
fixture = self.get_fixture_dir_abs(
'2014-11-3days-enwiki-day-times-100-plus-hour')
date = datetime.date(2014, 11, 2)
enwiki_file_abs = os.path.join(self.daily_raw_dir_abs, 'enwiki.csv')
self.create_empty_file(... |
425 | ed3357f6e5e2b3cea8030c15864c99a4 | swh:1:cnt:24d613005841dfc5513baba5b40a8e29616547b1;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=135-157/ | 870780f1c05b613bd7044e8bb60ff1118ace8d2f | aggregator | analytics | tests/test_projectcounts/test_per_project_aggregation.py | ProjectAggregationTestCase::test_update_per_project_single_csvs_3days_prefilled(self) | function | def test_update_per_project_single_csvs_3days_prefilled(self):
fixture = self.get_fixture_dir_abs(
'2014-11-3days-enwiki-day-times-100-plus-hour')
date = datetime.date(2014, 11, 2)
enwiki_file_abs = os.path.join(self.daily_raw_dir_abs, 'enwiki.csv')
self.create_file(enwiki_... |
426 | b1dd47ee86dac3da543af278ce7c7afe | swh:1:cnt:24d613005841dfc5513baba5b40a8e29616547b1;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=223-240/ | 870780f1c05b613bd7044e8bb60ff1118ace8d2f | aggregator | analytics | tests/test_projectcounts/test_per_project_aggregation.py | ProjectAggregationTestCase::test_update_daily_forced_recomputation_missing_hours(self) | function | def test_update_daily_forced_recomputation_missing_hours(self):
fixture = self.get_fixture_dir_abs('2014-11-missing-hours')
date = datetime.date(2014, 11, 1)
enwiki_file_abs = os.path.join(self.daily_raw_dir_abs, 'enwiki.csv')
self.create_file(enwiki_file_abs, [
'2014-11-01... |
427 | 7da91c6ccaa93cb6c450b1ff7e7840b7 | swh:1:cnt:24d613005841dfc5513baba5b40a8e29616547b1;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=41-55/ | 870780f1c05b613bd7044e8bb60ff1118ace8d2f | aggregator | analytics | tests/test_projectcounts/test_per_project_aggregation.py | ProjectAggregationTestCase::test_update_per_project_single_csvs_missing_hours(self) | function | def test_update_per_project_single_csvs_missing_hours(self):
fixture = self.get_fixture_dir_abs('2014-11-missing-hours')
date = datetime.date(2014, 11, 1)
enwiki_file_abs = os.path.join(self.daily_raw_dir_abs, 'enwiki.csv')
self.create_empty_file(enwiki_file_abs)
nose.tools.as... |
428 | b7a2cf914eed82bbb00df065cbfcb7cc | swh:1:cnt:24d613005841dfc5513baba5b40a8e29616547b1;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=242-288/ | 870780f1c05b613bd7044e8bb60ff1118ace8d2f | aggregator | analytics | tests/test_projectcounts/test_per_project_aggregation.py | ProjectAggregationTestCase::test_update_per_project_additional_aggregators(self) | function | def test_update_per_project_additional_aggregators(self):
fixture = self.get_fixture_dir_abs(
'2014-11-3days-enwiki-day-times-100-plus-hour')
first_date = datetime.date(2014, 11, 1)
last_date = datetime.date(2014, 11, 3)
# Mock an additional aggregator
funcMockParam... |
429 | 3e074b4515b5c6bdb70b4dbef7eeb124 | swh:1:cnt:24d613005841dfc5513baba5b40a8e29616547b1;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=57-76/ | 870780f1c05b613bd7044e8bb60ff1118ace8d2f | aggregator | analytics | tests/test_projectcounts/test_per_project_aggregation.py | ProjectAggregationTestCase::test_update_per_project_single_csvs_missing_hours_existing(self) | function | def test_update_per_project_single_csvs_missing_hours_existing(self):
fixture = self.get_fixture_dir_abs(
'2014-11-3days-enwiki-day-times-100-plus-hour')
date = datetime.date(2014, 11, 1)
enwiki_file_abs = os.path.join(self.daily_raw_dir_abs, 'enwiki.csv')
self.create_file(... |
430 | cd4194f6ec0ba18ef4d95715f92cfea1 | swh:1:cnt:24d613005841dfc5513baba5b40a8e29616547b1;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=252-257/ | 870780f1c05b613bd7044e8bb60ff1118ace8d2f | aggregator | analytics | tests/test_projectcounts/test_per_project_aggregation.py | ProjectAggregationTestCase::test_update_per_project_additional_aggregators::funcMock(target_dir_abs, dbname, csv_data_input, first_date,
last_date, bad_dates, force_recomputation) | function | def funcMock(target_dir_abs, dbname, csv_data_input, first_date,
last_date, bad_dates, force_recomputation):
funcMockParams.append([
target_dir_abs, dbname, csv_data_input, first_date, last_date,
bad_dates, force_recomputation
]) |
431 | 03df273258d597a5706cd3e120e47878 | swh:1:cnt:24d613005841dfc5513baba5b40a8e29616547b1;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=290-340/ | 870780f1c05b613bd7044e8bb60ff1118ace8d2f | aggregator | analytics | tests/test_projectcounts/test_per_project_aggregation.py | ProjectAggregationTestCase::test_update_per_project_additional_aggregators_with_parameters(self) | function | def test_update_per_project_additional_aggregators_with_parameters(self):
fixture = self.get_fixture_dir_abs(
'2014-11-3days-enwiki-day-times-100-plus-hour')
first_date = datetime.date(2014, 11, 1)
last_date = datetime.date(2014, 11, 3)
# Mock an additional aggregator
... |
432 | 554f446e1b792345dc1625be8060c143 | swh:1:cnt:24d613005841dfc5513baba5b40a8e29616547b1;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=159-177/ | 870780f1c05b613bd7044e8bb60ff1118ace8d2f | aggregator | analytics | tests/test_projectcounts/test_per_project_aggregation.py | ProjectAggregationTestCase::test_update_per_project_single_csvs_3days_doubled(self) | function | def test_update_per_project_single_csvs_3days_doubled(self):
fixture = self.get_fixture_dir_abs(
'2014-11-3days-enwiki-day-times-100-plus-hour')
date = datetime.date(2014, 11, 2)
enwiki_file_abs = os.path.join(self.daily_raw_dir_abs, 'enwiki.csv')
self.create_file(enwiki_fi... |
433 | 07bc54515a70769a2236fb9cfbbd0dcc | swh:1:cnt:24d613005841dfc5513baba5b40a8e29616547b1;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=342-389/ | 870780f1c05b613bd7044e8bb60ff1118ace8d2f | aggregator | analytics | tests/test_projectcounts/test_per_project_aggregation.py | ProjectAggregationTestCase::test_update_per_project_additional_aggregators_using_projectview(self) | function | def test_update_per_project_additional_aggregators_using_projectview(self):
fixture = self.get_fixture_dir_abs(
'2014-11-3days-enwiki-day-times-100-plus-hour-projectviews')
first_date = datetime.date(2014, 11, 1)
last_date = datetime.date(2014, 11, 3)
# Mock an additional a... |
434 | e329df5510ba51da0b4103aab56b9604 | swh:1:cnt:24d613005841dfc5513baba5b40a8e29616547b1;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=33-39/ | 870780f1c05b613bd7044e8bb60ff1118ace8d2f | aggregator | analytics | tests/test_projectcounts/test_per_project_aggregation.py | ProjectAggregationTestCase::test_update_per_project_no_csvs(self) | function | def test_update_per_project_no_csvs(self):
fixture = self.get_fixture_dir_abs('2014-11-missing-hours')
date = datetime.date(2014, 11, 1)
aggregator.update_per_project_csvs_for_dates(
fixture, self.data_dir_abs, date, date) |
435 | 5e0015a42d4155fc1aef16cc3722a268 | swh:1:cnt:24d613005841dfc5513baba5b40a8e29616547b1;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=179-199/ | 870780f1c05b613bd7044e8bb60ff1118ace8d2f | aggregator | analytics | tests/test_projectcounts/test_per_project_aggregation.py | ProjectAggregationTestCase::test_update_per_project_single_csvs_3days_prefilled_range(self) | function | def test_update_per_project_single_csvs_3days_prefilled_range(self):
fixture = self.get_fixture_dir_abs(
'2014-11-3days-enwiki-day-times-100-plus-hour')
first_date = datetime.date(2014, 11, 1)
last_date = datetime.date(2014, 11, 3)
enwiki_file_abs = os.path.join(self.daily_... |
436 | cc487c0bc45a516ae5fd80e7d71025c7 | swh:1:cnt:24d613005841dfc5513baba5b40a8e29616547b1;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=391-417/ | 870780f1c05b613bd7044e8bb60ff1118ace8d2f | aggregator | analytics | tests/test_projectcounts/test_per_project_aggregation.py | ProjectAggregationTestCase::test_update_per_project_compute_all_projects(self) | function | def test_update_per_project_compute_all_projects(self):
fixture = self.get_fixture_dir_abs(
'2014-11-3projects-for-aggregation')
first_date = datetime.date(2014, 11, 1)
last_date = datetime.date(2014, 11, 3)
enwiki_file_abs = os.path.join(self.daily_raw_dir_abs, 'enwiki.csv... |
437 | 246941422a4d3c9017dae8cfd3c227ec | swh:1:cnt:b15a0e4cd2f7f657e116c512dee66346dc5c3c3d;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=30-297/ | 2bfcc883732825362a8156f0586c9e0bad409058 | aggregator | analytics | tests/test_projectcounts/test_weekly_aggregation.py | WeeklyProjectAggregationTestCase | type | class WeeklyProjectAggregationTestCase(testcases.ProjectcountsDataTestCase):
"""TestCase for 'weekly' project aggregation functions"""
def test_weekly_csv_non_existing_csv(self):
enwiki_file_abs = os.path.join(self.weekly_dir_abs, 'enwiki.csv')
first_date = datetime.date(2014, 7, 1)
las... |
438 | 7f18a57492abea59be8ac6dabf8ab990 | swh:1:cnt:b15a0e4cd2f7f657e116c512dee66346dc5c3c3d;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=122-156/ | 2bfcc883732825362a8156f0586c9e0bad409058 | aggregator | analytics | tests/test_projectcounts/test_weekly_aggregation.py | WeeklyProjectAggregationTestCase::test_weekly_csv_existing_csv_bad_dates_existing_week(self) | function | def test_weekly_csv_existing_csv_bad_dates_existing_week(self):
enwiki_file_abs = os.path.join(self.weekly_dir_abs, 'enwiki.csv')
self.create_file(enwiki_file_abs, [
'2014W26,1,2,3,4',
'2014W27,4,5,6,7',
'2014W28,8,9,10,11',
])
first_date = dateti... |
439 | b3cf30b26424a5b135dbbca73efe9017 | swh:1:cnt:b15a0e4cd2f7f657e116c512dee66346dc5c3c3d;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=57-87/ | 2bfcc883732825362a8156f0586c9e0bad409058 | aggregator | analytics | tests/test_projectcounts/test_weekly_aggregation.py | WeeklyProjectAggregationTestCase::test_weekly_csv_existing_csv_existing_week(self) | function | def test_weekly_csv_existing_csv_existing_week(self):
enwiki_file_abs = os.path.join(self.weekly_dir_abs, 'enwiki.csv')
self.create_file(enwiki_file_abs, [
'2014W26,1,2,3,4',
'2014W27,4,5,6,7',
'2014W28,8,9,10,11',
])
first_date = datetime.date(20... |
440 | 9b5d1c4f882d2a6bc1180263f49ab17f | swh:1:cnt:b15a0e4cd2f7f657e116c512dee66346dc5c3c3d;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=195-232/ | 2bfcc883732825362a8156f0586c9e0bad409058 | aggregator | analytics | tests/test_projectcounts/test_weekly_aggregation.py | WeeklyProjectAggregationTestCase::test_weekly_csv_existing_csv_only_bad_dates_no_existing_data(self) | function | def test_weekly_csv_existing_csv_only_bad_dates_no_existing_data(self):
enwiki_file_abs = os.path.join(self.weekly_dir_abs, 'enwiki.csv')
self.create_file(enwiki_file_abs, [
'2014W26,1,2,3,4',
'2014W28,8,9,10,11',
])
first_date = datetime.date(2014, 7, 1)
... |
441 | 612257d599f287adaf0de97455cab89c | swh:1:cnt:b15a0e4cd2f7f657e116c512dee66346dc5c3c3d;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=32-55/ | 2bfcc883732825362a8156f0586c9e0bad409058 | aggregator | analytics | tests/test_projectcounts/test_weekly_aggregation.py | WeeklyProjectAggregationTestCase::test_weekly_csv_non_existing_csv(self) | function | def test_weekly_csv_non_existing_csv(self):
enwiki_file_abs = os.path.join(self.weekly_dir_abs, 'enwiki.csv')
first_date = datetime.date(2014, 7, 1)
last_date = datetime.date(2014, 7, 7)
csv_data = {
'2014-06-29': '2014-06-29,1,2,3,4',
'2014-06-30': '2014-06-30,... |
442 | 8bf6c4ade114d13449d96e103bfe13a5 | swh:1:cnt:b15a0e4cd2f7f657e116c512dee66346dc5c3c3d;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=89-120/ | 2bfcc883732825362a8156f0586c9e0bad409058 | aggregator | analytics | tests/test_projectcounts/test_weekly_aggregation.py | WeeklyProjectAggregationTestCase::test_weekly_csv_existing_csv_existing_week_force(self) | function | def test_weekly_csv_existing_csv_existing_week_force(self):
enwiki_file_abs = os.path.join(self.weekly_dir_abs, 'enwiki.csv')
self.create_file(enwiki_file_abs, [
'2014W26,1,2,3,4',
'2014W27,4,5,6,7',
'2014W28,8,9,10,11',
])
first_date = datetime.d... |
443 | 97b8c17e1a715e63d9fe8931f78c0226 | swh:1:cnt:b15a0e4cd2f7f657e116c512dee66346dc5c3c3d;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=158-193/ | 2bfcc883732825362a8156f0586c9e0bad409058 | aggregator | analytics | tests/test_projectcounts/test_weekly_aggregation.py | WeeklyProjectAggregationTestCase::test_weekly_csv_existing_csv_bad_sunday(self) | function | def test_weekly_csv_existing_csv_bad_sunday(self):
enwiki_file_abs = os.path.join(self.weekly_dir_abs, 'enwiki.csv')
self.create_file(enwiki_file_abs, [
'2014W26,1,2,3,4',
'2014W27,4,5,6,7',
'2014W28,8,9,10,11',
])
first_date = datetime.date(2014,... |
444 | dda2905b218f24572523e1154765e720 | swh:1:cnt:b15a0e4cd2f7f657e116c512dee66346dc5c3c3d;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=234-272/ | 2bfcc883732825362a8156f0586c9e0bad409058 | aggregator | analytics | tests/test_projectcounts/test_weekly_aggregation.py | WeeklyProjectAggregationTestCase::test_weekly_csv_existing_csv_only_bad_dates_existing_data(self) | function | def test_weekly_csv_existing_csv_only_bad_dates_existing_data(self):
enwiki_file_abs = os.path.join(self.weekly_dir_abs, 'enwiki.csv')
self.create_file(enwiki_file_abs, [
'2014W26,1,2,3,4',
'2014W27,4,5,6,7',
'2014W28,8,9,10,11',
])
first_date = d... |
445 | 6153243192599f9d58bbb616f3de3754 | swh:1:cnt:b15a0e4cd2f7f657e116c512dee66346dc5c3c3d;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=274-297/ | 2bfcc883732825362a8156f0586c9e0bad409058 | aggregator | analytics | tests/test_projectcounts/test_weekly_aggregation.py | WeeklyProjectAggregationTestCase::test_weekly_csv_zero_and_missing_data(self) | function | def test_weekly_csv_zero_and_missing_data(self):
enwiki_file_abs = os.path.join(self.weekly_dir_abs, 'enwiki.csv')
first_date = datetime.date(2014, 7, 1)
last_date = datetime.date(2014, 7, 7)
csv_data = {
'2014-06-29': '2014-06-29,1,2,3,4',
'2014-06-30': '2014-0... |
446 | 6177669125344dada556dc66ee695f04 | swh:1:cnt:c84a633adbde8704ec3665adfb617d075f552098;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=30-306/ | 637bc8e343f85bc2ae281e575fe4facde84d5e5a | aggregator | analytics | tests/test_projectcounts/test_yearly_aggregation.py | YearlyProjectAggregationTestCase | type | class YearlyProjectAggregationTestCase(testcases.ProjectcountsDataTestCase):
"""TestCase for 'yearly' project aggregation functions"""
def test_yearly_csv_non_existing_csv_365_day_year(self):
enwiki_file_abs = os.path.join(self.yearly_dir_abs, 'enwiki.csv')
first_date = datetime.date(2014, 12, ... |
447 | fc50c0ef9766df87580dbda568ddc110 | swh:1:cnt:c84a633adbde8704ec3665adfb617d075f552098;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=143-177/ | 637bc8e343f85bc2ae281e575fe4facde84d5e5a | aggregator | analytics | tests/test_projectcounts/test_yearly_aggregation.py | YearlyProjectAggregationTestCase::test_yearly_csv_existing_csv_bad_dates_existing_year(self) | function | def test_yearly_csv_existing_csv_bad_dates_existing_year(self):
enwiki_file_abs = os.path.join(self.yearly_dir_abs, 'enwiki.csv')
self.create_file(enwiki_file_abs, [
'2013,1,2,3,4',
'2014,4,5,6,7',
'2015,8,9,10,11',
])
first_date = datetime.date(2... |
448 | 5a6a482d2be79541e791c3b0352fc8cf | swh:1:cnt:c84a633adbde8704ec3665adfb617d075f552098;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=80-109/ | 637bc8e343f85bc2ae281e575fe4facde84d5e5a | aggregator | analytics | tests/test_projectcounts/test_yearly_aggregation.py | YearlyProjectAggregationTestCase::test_yearly_csv_existing_csv_existing_year(self) | function | def test_yearly_csv_existing_csv_existing_year(self):
enwiki_file_abs = os.path.join(self.yearly_dir_abs, 'enwiki.csv')
self.create_file(enwiki_file_abs, [
'2013,1,2,3,4',
'2014,4,5,6,7',
'2015,8,9,10,11',
])
first_date = datetime.date(2014, 12, 2... |
449 | 013d351d6ffcc42765ea188d3cf05305 | swh:1:cnt:c84a633adbde8704ec3665adfb617d075f552098;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=216-246/ | 637bc8e343f85bc2ae281e575fe4facde84d5e5a | aggregator | analytics | tests/test_projectcounts/test_yearly_aggregation.py | YearlyProjectAggregationTestCase::test_yearly_csv_existing_csv_only_bad_dates_no_existing_data(self) | function | def test_yearly_csv_existing_csv_only_bad_dates_no_existing_data(self):
enwiki_file_abs = os.path.join(self.yearly_dir_abs, 'enwiki.csv')
self.create_file(enwiki_file_abs, [
'2013,1,2,3,4',
'2015,8,9,10,11',
])
first_date = datetime.date(2014, 12, 20)
... |
450 | 02707b712865a47aa054273ad343ec5d | swh:1:cnt:c84a633adbde8704ec3665adfb617d075f552098;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=32-54/ | 637bc8e343f85bc2ae281e575fe4facde84d5e5a | aggregator | analytics | tests/test_projectcounts/test_yearly_aggregation.py | YearlyProjectAggregationTestCase::test_yearly_csv_non_existing_csv_365_day_year(self) | function | def test_yearly_csv_non_existing_csv_365_day_year(self):
enwiki_file_abs = os.path.join(self.yearly_dir_abs, 'enwiki.csv')
first_date = datetime.date(2014, 12, 20)
last_date = datetime.date(2014, 12, 31)
csv_data = {
'2013-12-31': '2013-12-31,1,2,3,4',
'2015-01-... |
451 | f89e0ab7809d4186c12a4781b3fcf5b1 | swh:1:cnt:c84a633adbde8704ec3665adfb617d075f552098;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=56-78/ | 637bc8e343f85bc2ae281e575fe4facde84d5e5a | aggregator | analytics | tests/test_projectcounts/test_yearly_aggregation.py | YearlyProjectAggregationTestCase::test_yearly_csv_non_existing_csv_366_day_year(self) | function | def test_yearly_csv_non_existing_csv_366_day_year(self):
enwiki_file_abs = os.path.join(self.yearly_dir_abs, 'enwiki.csv')
first_date = datetime.date(2012, 12, 20)
last_date = datetime.date(2012, 12, 31)
csv_data = {
'2011-12-31': '2011-12-31,1,2,3,4',
'2013-01-... |
452 | 4534e5c09e5647be7e060602c07c5e75 | swh:1:cnt:c84a633adbde8704ec3665adfb617d075f552098;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=111-141/ | 637bc8e343f85bc2ae281e575fe4facde84d5e5a | aggregator | analytics | tests/test_projectcounts/test_yearly_aggregation.py | YearlyProjectAggregationTestCase::test_yearly_csv_existing_csv_existing_year_force(self) | function | def test_yearly_csv_existing_csv_existing_year_force(self):
enwiki_file_abs = os.path.join(self.yearly_dir_abs, 'enwiki.csv')
self.create_file(enwiki_file_abs, [
'2013,1,2,3,4',
'2014,4,5,6,7',
'2015,8,9,10,11',
])
first_date = datetime.date(2014,... |
453 | 450e4d006c8b297a75f3f7ca534b092d | swh:1:cnt:c84a633adbde8704ec3665adfb617d075f552098;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=179-214/ | 637bc8e343f85bc2ae281e575fe4facde84d5e5a | aggregator | analytics | tests/test_projectcounts/test_yearly_aggregation.py | YearlyProjectAggregationTestCase::test_yearly_csv_existing_csv_bad_last_day(self) | function | def test_yearly_csv_existing_csv_bad_last_day(self):
enwiki_file_abs = os.path.join(self.yearly_dir_abs, 'enwiki.csv')
self.create_file(enwiki_file_abs, [
'2013,1,2,3,4',
'2014,4,5,6,7',
'2015,8,9,10,11',
])
first_date = datetime.date(2014, 12, 20... |
454 | dc094f5283fb88ac0be59ba9e1992bb8 | swh:1:cnt:c84a633adbde8704ec3665adfb617d075f552098;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=248-279/ | 637bc8e343f85bc2ae281e575fe4facde84d5e5a | aggregator | analytics | tests/test_projectcounts/test_yearly_aggregation.py | YearlyProjectAggregationTestCase::test_yearly_csv_existing_csv_only_bad_dates_existing_data(self) | function | def test_yearly_csv_existing_csv_only_bad_dates_existing_data(self):
enwiki_file_abs = os.path.join(self.yearly_dir_abs, 'enwiki.csv')
self.create_file(enwiki_file_abs, [
'2013,1,2,3,4',
'2014,4,5,6,7',
'2015,8,9,10,11',
])
first_date = datetime.d... |
455 | 3f3a3a38cfff2b04363d42ef111e0a72 | swh:1:cnt:c84a633adbde8704ec3665adfb617d075f552098;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=281-306/ | 637bc8e343f85bc2ae281e575fe4facde84d5e5a | aggregator | analytics | tests/test_projectcounts/test_yearly_aggregation.py | YearlyProjectAggregationTestCase::test_yearly_csv_zero_and_missing_data(self) | function | def test_yearly_csv_zero_and_missing_data(self):
enwiki_file_abs = os.path.join(self.yearly_dir_abs, 'enwiki.csv')
first_date = datetime.date(2014, 12, 20)
last_date = datetime.date(2014, 12, 31)
csv_data = {
'2013-12-31': '2013-12-31,1,2,3,4',
'2015-01-01': '20... |
456 | 118761236b3c3cea5eb648c16b1416d2 | swh:1:cnt:4f0a33bb8b675b1e7b1a87989929d5d4c7364224;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=183-198/ | 1171e810329dcb5ed85d71d6f582b1431b4bbae6 | jsonschema-tools | analytics | lib/jsonschema-tools.js | schemaKeyCompare | function | /**
* Comparison function for schema keys.
* @param {string} k1
* @param {string} k2
* @return {int}
*/
function schemaKeyCompare(k1, k2) {
if (k1 in schemaKeySortOrder && k2 in schemaKeySortOrder) {
return schemaKeySortOrder[k1] - schemaKeySortOrder[k2];
} else if (k1 in schemaKeySortOrder) {
... |
457 | fa7072b8b098f12c6e9b51cd9b1d40eb | swh:1:cnt:4f0a33bb8b675b1e7b1a87989929d5d4c7364224;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=220-234/ | 1171e810329dcb5ed85d71d6f582b1431b4bbae6 | jsonschema-tools | analytics | lib/jsonschema-tools.js | serialize | function | /**
* Serializes the object as the given contentType, either yaml or json.
* @param {Object} object
* @param {string} contentType
* @return {string}
*/
function serialize(object, contentType = 'yaml') {
if (_.isUndefined(serializers[contentType])) {
throw new Error(
`No serializer for ${con... |
458 | 1003f6e2dfa017afc33c175a7a22cef9 | swh:1:cnt:4f0a33bb8b675b1e7b1a87989929d5d4c7364224;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=236-243/ | 1171e810329dcb5ed85d71d6f582b1431b4bbae6 | jsonschema-tools | analytics | lib/jsonschema-tools.js | readObject | function | /**
* Reads in a yaml or json file from file
* @param {string|int} file string path or int file descriptor to read
* @return {Promise<Object>} read and parsed object
*/
async function readObject(file) {
return yaml.safeLoad(await fse.readFile(file, 'utf-8'), { filename: file });
} |
459 | 5dd059787f37210122bf8690c1c73cef | swh:1:cnt:4f0a33bb8b675b1e7b1a87989929d5d4c7364224;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=266-325/ | 1171e810329dcb5ed85d71d6f582b1431b4bbae6 | jsonschema-tools | analytics | lib/jsonschema-tools.js | readConfig | function | /**
* Loads jsonschema-tools config file(s) and returns merged options
* with defaultOptions object. If config files have already been read
* once by this process, this will just return options as is.
* Set force=true to override this to always read config files.
* If force=false, it is expected that the options ... |
460 | 082f2977d4fc20c576d73dc3d690d2c4 | swh:1:cnt:4f0a33bb8b675b1e7b1a87989929d5d4c7364224;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=503-523/ | 1171e810329dcb5ed85d71d6f582b1431b4bbae6 | jsonschema-tools | analytics | lib/jsonschema-tools.js | createSymlink | function | /**
* Creates a symlink at symlinkPath pointing at targetPath.
* @param {string} targetPath
* @param {string} symlinkPath
* @return {Promise} resolves when symlink is created
*/
async function createSymlink(targetPath, symlinkPath) {
try {
await fse.unlink(symlinkPath);
} catch (err) {
if (... |
461 | 8c983a2a6242775eac3102671de6d442 | swh:1:cnt:4f0a33bb8b675b1e7b1a87989929d5d4c7364224;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=551-569/ | 1171e810329dcb5ed85d71d6f582b1431b4bbae6 | jsonschema-tools | analytics | lib/jsonschema-tools.js | gitModifiedSchemaPaths | function | /**
* Finds modified paths in options.schemaBasePath. If options.gitStaged, this will look for
* modified staged files. Else this will look for unstaged modified files.
* File paths will be returned as absolute paths resolved relative to the
* discovered git root of options.schemaBasePath.
* @param {Object} opti... |
462 | b1a82dd2b76ae257d914d6f13a0dbe8e | swh:1:cnt:4f0a33bb8b675b1e7b1a87989929d5d4c7364224;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=825-836/ | 1171e810329dcb5ed85d71d6f582b1431b4bbae6 | jsonschema-tools | analytics | lib/jsonschema-tools.js | materializeSchemaVersion | function | /**
* @deprecated
* Materializes a versioned schema file in the directory.
*
* @param {string} schemaDirectory directory in which to materialize schema
* @param {Object} schema Schema to materialize
* @param {Object} options
* @return {Promise<string>} path of newly materialized files
*/
async function material... |
463 | 148d4af4a73261c38b10ffabb234f5c2 | swh:1:cnt:4f0a33bb8b675b1e7b1a87989929d5d4c7364224;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=1030-1039/ | 1171e810329dcb5ed85d71d6f582b1431b4bbae6 | jsonschema-tools | analytics | lib/jsonschema-tools.js | findSchemasByTitleAndMajor | function | /**
* Finds all schemas in options.schemaBasePath, converts them to schema info objects,
* and groups them by schema title and major version
* @param {Object} options
* @return {Object}
*/
function findSchemasByTitleAndMajor(options = {}) {
options = readConfig(options);
return groupSchemasByTitleAndMajor(... |
464 | 9abf112a264c181921a76b1323c66f0a | swh:1:cnt:4f0a33bb8b675b1e7b1a87989929d5d4c7364224;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=1041-1055/ | 1171e810329dcb5ed85d71d6f582b1431b4bbae6 | jsonschema-tools | analytics | lib/jsonschema-tools.js | materializeAllSchemas | function | /**
* Finds all current schema files in options.schemasBasePath and materializes them.
* @param {Object} options
* @return {Array} generated schema file paths
*/
async function materializeAllSchemas(options = {}) {
options = readConfig(options);
const currentSchemasInfo = (await findAllSchemasInfo(options))... |
465 | 05abcde4b5e06b11fe9310f428a160bf | swh:1:cnt:4f0a33bb8b675b1e7b1a87989929d5d4c7364224;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=254-263/ | 1171e810329dcb5ed85d71d6f582b1431b4bbae6 | jsonschema-tools | analytics | lib/jsonschema-tools.js | writeObject | function | /**
* Serializes object and writes to file.
* @param {Object} object object to serialize and write to file
* @param {string|int} file string path or int file descriptor to write
* @param {string} contentType either 'yaml' or 'json'
* @return {Promise} result of fse.writeFile
*/
function writeObject(object, file, ... |
466 | 49350fc939f3ee980493c8057a0df142 | swh:1:cnt:4f0a33bb8b675b1e7b1a87989929d5d4c7364224;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=350-357/ | 1171e810329dcb5ed85d71d6f582b1431b4bbae6 | jsonschema-tools | analytics | lib/jsonschema-tools.js | uriHasProtocol | function | /**
* Returns true if the uri has protocol schema on the front, else false.
* @param {string} uri
* @return {boolean}
*/
function uriHasProtocol(uri) {
return uriProtocolRegex.test(uri);
} |
467 | 825cd33f014149bdafae36b22118953c | swh:1:cnt:4f0a33bb8b675b1e7b1a87989929d5d4c7364224;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=386-459/ | 1171e810329dcb5ed85d71d6f582b1431b4bbae6 | jsonschema-tools | analytics | lib/jsonschema-tools.js | createSchemaResolver | function | /**
* Create a schema resolver wrapper for both file and http.
* We want to be able to prefix any $ref URI in a schema with
* schema base URIs in order to look up schemas from a configurable
* local or remote URL. The returned object should be passed to
* RefParser.dereference options as the 'resolve' object.
* ... |
468 | cf5b2f97dc66265614bb0b889be61fa1 | swh:1:cnt:4f0a33bb8b675b1e7b1a87989929d5d4c7364224;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=671-696/ | 1171e810329dcb5ed85d71d6f582b1431b4bbae6 | jsonschema-tools | analytics | lib/jsonschema-tools.js | generateSchemaExample | function | /**
* If the schema doesn't already have an example,
* generate one and add it to the schema examples.
*
* @param {Object} schema
* @param {Object} options
* @param {string} options.schemaVersionField
* If the schema has a $schema property, in the example it
* will always be set to the schemaVersionField ($id... |
469 | b995f808dee55d517e5cb2d9261c257b | swh:1:cnt:4f0a33bb8b675b1e7b1a87989929d5d4c7364224;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=698-719/ | 1171e810329dcb5ed85d71d6f582b1431b4bbae6 | jsonschema-tools | analytics | lib/jsonschema-tools.js | materializeSchema | function | /**
* Outputs a given schema with any modifications specified in the options,
* including but not limited to dereferencing and enforcing numeric bounds.
*
* @param {Object} schema Schema to materialize
* @param {Object} options
* @return {Object} modified schema
*/
async function materializeSchema(schema, option... |
470 | 6f186ef38b7a458a1904a0f16f188241 | swh:1:cnt:4f0a33bb8b675b1e7b1a87989929d5d4c7364224;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=942-965/ | 1171e810329dcb5ed85d71d6f582b1431b4bbae6 | jsonschema-tools | analytics | lib/jsonschema-tools.js | schemaInfoCompare | function | /**
* Compare function for schema info, used for sorting based
* on 'common' schema, title, semver, and 'current'.
* There's no good way to know of schema dependency order without
* building a graph, but we can at least guess with some good heuristics.
*
* @param {Object} infoA
* @param {Objectt} infoB
* @retur... |
471 | 5d73e2c8e327f21912feef21699926af | swh:1:cnt:4f0a33bb8b675b1e7b1a87989929d5d4c7364224;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=1000-1010/ | 1171e810329dcb5ed85d71d6f582b1431b4bbae6 | jsonschema-tools | analytics | lib/jsonschema-tools.js | findSchemasByTitle | function | /**
* Finds all schemas in options.schemaBasePath, converts them to schema info objects,
* and groups them by schema title
* @param {string} schemaBasePath
* @param {Object} options
* @return {Object}
*/
function findSchemasByTitle(options = {}) {
options = readConfig(options);
return groupSchemasByTitle(... |
472 | d59bd9f136cb57c3886a36a9f008d1f3 | swh:1:cnt:4f0a33bb8b675b1e7b1a87989929d5d4c7364224;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=1057-1076/ | 1171e810329dcb5ed85d71d6f582b1431b4bbae6 | jsonschema-tools | analytics | lib/jsonschema-tools.js | enforceNumericBounds | function | /**
* Traverses through all the fields in the schema, including nested properties, and
* sets the numeric bounds specified in options when the object type is number.
* @param {Object} schema
* @param {Array} bounds as specified in options
* @return {Object} schema with bounded numeric fields
*/
function enforceNu... |
473 | bc5ba1d8a786389be99f3c30fc657bf3 | swh:1:cnt:4f0a33bb8b675b1e7b1a87989929d5d4c7364224;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=432-434/ | 1171e810329dcb5ed85d71d6f582b1431b4bbae6 | jsonschema-tools | analytics | lib/jsonschema-tools.js | createSchemaResolver::canRead | function | canRead(file) {
return fileResolver.canRead(file) || httpResolver.canRead(file);
} |
474 | 2c2d8f30a80a422184da1ae001b5f4d3 | swh:1:cnt:4f0a33bb8b675b1e7b1a87989929d5d4c7364224;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=245-252/ | 1171e810329dcb5ed85d71d6f582b1431b4bbae6 | jsonschema-tools | analytics | lib/jsonschema-tools.js | readObjectSync | function | /**
* Synchronous version of readObject
* @param {string|int} file
* @return {Object}
*/
function readObjectSync(file) {
return yaml.safeLoad(fse.readFileSync(file, 'utf-8'), { filename: file });
} |
475 | 63b2990fea3f9085dc0aaf35fcf14259 | swh:1:cnt:4f0a33bb8b675b1e7b1a87989929d5d4c7364224;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=200-210/ | 1171e810329dcb5ed85d71d6f582b1431b4bbae6 | jsonschema-tools | analytics | lib/jsonschema-tools.js | jsonStableStringifySchemaCompare | function | /**
* schema cmp function for json-stable-stringify.
* Calls schemaKeyCompare with the keys being compared.
* See: https://www.npmjs.com/package/json-stable-stringify#cmp
* @param {string} kv1
* @param {*} kv2
* @return {int}
*/
function jsonStableStringifySchemaCompare(kv1, kv2) {
return schemaKeyCompare(kv... |
476 | 676eb6fba21cbe09bf71ea38737a3599 | swh:1:cnt:4f0a33bb8b675b1e7b1a87989929d5d4c7364224;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=461-472/ | 1171e810329dcb5ed85d71d6f582b1431b4bbae6 | jsonschema-tools | analytics | lib/jsonschema-tools.js | getSchemaById | function | /**
* Uses options.schemaBaseUris to resolve a schema $id URI
* and return the first schema found.
* @param {String} schemaId Schema $id URI.
* @param {Object} options
* @return {Promise<Object>} schema at $id in one of the options.schemaBaseUris
*/
async function getSchemaById(schemaId, options) {
options = ... |
477 | 5c8fa449b1c254056f59d9b12726e8ab | swh:1:cnt:4f0a33bb8b675b1e7b1a87989929d5d4c7364224;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=539-549/ | 1171e810329dcb5ed85d71d6f582b1431b4bbae6 | jsonschema-tools | analytics | lib/jsonschema-tools.js | gitAdd | function | /**
* Stages paths into the git repository at gitRoot via git add.
* @param {Array<string>} paths
* @param {Object} options
* @return {Object}
*/
async function gitAdd(paths, options = {}) {
options = readConfig(options);
const command = `git add ${paths.join(' ')}`;
return execCommand(command, { cwd: ... |
478 | 7ffb6e5e39816d3599ab3e4ecd30ed11 | swh:1:cnt:4f0a33bb8b675b1e7b1a87989929d5d4c7364224;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=603-668/ | 1171e810329dcb5ed85d71d6f582b1431b4bbae6 | jsonschema-tools | analytics | lib/jsonschema-tools.js | dereferenceSchema | function | /**
* Uses the options.schemaBaseUris to create http and file schema resolvers
* that prefix schema URIs in $refs with with the base URIs. These
* resolved URLs are then dereferenced in place.
* @param {Object} schema
* @param {Object} options
* @return {Promise<Object>} dereferenced schema
*/
async function de... |
479 | b7d4fd3e68a47ddb1d5a44c1711d6797 | swh:1:cnt:4f0a33bb8b675b1e7b1a87989929d5d4c7364224;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=721-823/ | 1171e810329dcb5ed85d71d6f582b1431b4bbae6 | jsonschema-tools | analytics | lib/jsonschema-tools.js | materializeSchemaToPath | function | /**
* Materializes a versioned schema file in the directory.
*
* @param {string} schemaDirectory directory in which to materialize schema
* @param {Object} schema Schema to materialize
* @param {Object} options
* @return {Promise<string>} path of newly materialized files
*/
async function materializeSchemaToPath... |
480 | d083ad304333e8303757af5c13673337 | swh:1:cnt:4f0a33bb8b675b1e7b1a87989929d5d4c7364224;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=917-939/ | 1171e810329dcb5ed85d71d6f582b1431b4bbae6 | jsonschema-tools | analytics | lib/jsonschema-tools.js | findSchemaPaths | function | /**
* Looks in options.schemaBasePath for files that look like schema files.
* These are either X.Y.Z.<contentType> files or currentName.<contentType>
* files. Note: This function does not respect options.ignoreSchemas,
* since it does not read the discovered schema files.
* @param {Object} options
* @return {Arr... |
481 | 70ec730c7310fc327dd67bcdd1e4530a | swh:1:cnt:4f0a33bb8b675b1e7b1a87989929d5d4c7364224;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=967-988/ | 1171e810329dcb5ed85d71d6f582b1431b4bbae6 | jsonschema-tools | analytics | lib/jsonschema-tools.js | findAllSchemasInfo | function | /**
* Looks in options.schemaBasePath for files that look like schema files and
* then maps them using schemaPathToInfo, returning an object with
* info and schema.
* If any schema $id matches a regex in options.ignoreSchemas, it will
* not be included in returned values.
* @param {Object} options
* @return {Obj... |
482 | 63a2ad2e9cbd84d2a12c78ef09b18433 | swh:1:cnt:4f0a33bb8b675b1e7b1a87989929d5d4c7364224;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=1012-1028/ | 1171e810329dcb5ed85d71d6f582b1431b4bbae6 | jsonschema-tools | analytics | lib/jsonschema-tools.js | groupSchemasByTitleAndMajor | function | /**
* Given a list of schemaInfo objects, this groups them by title and major version.
*
* @param {Object} schemaInfos
* @return {Object}
*/
function groupSchemasByTitleAndMajor(schemaInfos) {
const schemaInfosByTitle = groupSchemasByTitle(schemaInfos);
const schemaByTitleMajor = {};
_.keys(schemaInfo... |
483 | a798f87f709ff21e8bc57663068edebf | swh:1:cnt:4f0a33bb8b675b1e7b1a87989929d5d4c7364224;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=327-346/ | 1171e810329dcb5ed85d71d6f582b1431b4bbae6 | jsonschema-tools | analytics | lib/jsonschema-tools.js | execCommand | function | /**
* Runs (and logs) command in cwd.
* @param {string} command
* @param {string} execOptions options to pass to child_process.exec
* @param {Object} logger If given, will call logger.debug(command) before executing it.
* @return {Promise} result child_process#exec
*/
function execCommand(command, execOptions, lo... |
484 | e4198b35821ec0af8b188f967b505c99 | swh:1:cnt:4f0a33bb8b675b1e7b1a87989929d5d4c7364224;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=359-384/ | 1171e810329dcb5ed85d71d6f582b1431b4bbae6 | jsonschema-tools | analytics | lib/jsonschema-tools.js | resolveUri | function | /**
* Takes a possibly relative uri, and augments it so that it is better suited for use in requests.
* If the uri is already qualified (e.g. is starts with a protocol scheme), baseUri will
* not be prepended.
* If the baseUri given does not have a protocol schema, it is assumed to be file://.
* file:// paths will... |
485 | a4d33d5dc7e6eda84e44e93d90e40a5c | swh:1:cnt:4f0a33bb8b675b1e7b1a87989929d5d4c7364224;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=493-501/ | 1171e810329dcb5ed85d71d6f582b1431b4bbae6 | jsonschema-tools | analytics | lib/jsonschema-tools.js | extensionlessPath | function | /**
* Returns the filePath without a file extension.
* @param {string} filePath
* @return {string}
*/
function extensionlessPath(filePath) {
const parsedPath = path.parse(filePath);
return path.join(parsedPath.dir, parsedPath.name);
} |
486 | 53db0e6b9378cce1b239e81ff8838a4d | swh:1:cnt:4f0a33bb8b675b1e7b1a87989929d5d4c7364224;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=525-537/ | 1171e810329dcb5ed85d71d6f582b1431b4bbae6 | jsonschema-tools | analytics | lib/jsonschema-tools.js | findGitRoot | function | /**
* Finds the git root path relative to options.schemaBasePath
* @param {Object} options
* @return {string}
*/
async function findGitRoot(options = {}) {
options = readConfig(options);
return (await execCommand(
// Need to execute the git command in the schemaBasePath for it to find the
//... |
487 | 34b72e1aa2a5a1b22a80510a373c470d | swh:1:cnt:4f0a33bb8b675b1e7b1a87989929d5d4c7364224;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=474-491/ | 1171e810329dcb5ed85d71d6f582b1431b4bbae6 | jsonschema-tools | analytics | lib/jsonschema-tools.js | schemaVersion | function | /**
* Returns a semantic version from a schema given a field
* in that schema that contains the version number.
* This uses semver.coerce to get the version.
* If the schemaVersionField's value looks like a URI path,
* only the final basename element will be used to infer the schema.
* This is exported only for t... |
488 | 2e6aabc490e6da8af9c586919f13639f | swh:1:cnt:4f0a33bb8b675b1e7b1a87989929d5d4c7364224;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=571-601/ | 1171e810329dcb5ed85d71d6f582b1431b4bbae6 | jsonschema-tools | analytics | lib/jsonschema-tools.js | schemaPathToInfo | function | /**
* Given a path to a schema file, this returns an object describing the schema.
* If the schema at schemaPath does not have a title, assume it is invalid.
* A schema 'info' is an object like:
* {
* title: 'schema/title',
* path: '/path/to/schema/title/1.0.0.yaml',
* version: '1.0.0',
* current: true, // ... |
489 | dc519fa769767b185d01ae78a9b8eb2c | swh:1:cnt:4f0a33bb8b675b1e7b1a87989929d5d4c7364224;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=838-889/ | 1171e810329dcb5ed85d71d6f582b1431b4bbae6 | jsonschema-tools | analytics | lib/jsonschema-tools.js | materializeModifiedSchemas | function | /**
* Finds modified 'current' schema files in options.schemaBasePath and materializes them.
*
* @param {Object} options
* @return {Promise<Array<string>>} List of files that were generated
*/
async function materializeModifiedSchemas(options = {}) {
options = readConfig(options);
options.log.info(`Lookin... |
490 | 4988d2256e842b74c622735394de83a7 | swh:1:cnt:4f0a33bb8b675b1e7b1a87989929d5d4c7364224;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=901-914/ | 1171e810329dcb5ed85d71d6f582b1431b4bbae6 | jsonschema-tools | analytics | lib/jsonschema-tools.js | installGitHook | function | async function installGitHook(options) {
options = readConfig(options);
// Find gitRoot if it isn't provided.
const gitRoot = options.gitRoot || await findGitRoot(options);
const preCommitPath = path.join(gitRoot, '.git', 'hooks', 'pre-commit');
options.log.info(`Saving jsonschema-tools materialize... |
491 | d353d3a55dfe577c33252f66bf8f365d | swh:1:cnt:4f0a33bb8b675b1e7b1a87989929d5d4c7364224;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=436-457/ | 1171e810329dcb5ed85d71d6f582b1431b4bbae6 | jsonschema-tools | analytics | lib/jsonschema-tools.js | createSchemaResolver::read | function | async read(file) {
const files = _.map(schemaBaseUris, (baseUri) => {
const f = _.clone(file);
f.url = resolveUri(file.url, baseUri);
return f;
});
// This is a 'fold' like operation on the resolved file urls,
// keeping onl... |
492 | 2735cbc278db30561aac08543b74f35e | swh:1:cnt:4f0a33bb8b675b1e7b1a87989929d5d4c7364224;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=990-998/ | 1171e810329dcb5ed85d71d6f582b1431b4bbae6 | jsonschema-tools | analytics | lib/jsonschema-tools.js | groupSchemasByTitle | function | /**
* Given a list of schemaInfo objects, this groups them by title.
* @param {Object} schemaInfos
* @param {Object} options
* @return {Object}
*/
function groupSchemasByTitle(schemaInfos) {
return _.groupBy(schemaInfos, schemaInfo => schemaInfo.title);
} |
493 | 9ce28437dc92f35026116705d62e1cfe | swh:1:cnt:ca275c8156f1c4b5f6c36475f5ace6f93694025e;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=22-24/ | e3cb22f463ee6351df6e6982d70985ce90ab6442 | jsonschema-tools | analytics | lib/tests/compatibility.js | isAllowedToChange | function | function isAllowedToChange(fieldName) {
return FIELDS_ALLOWED_TO_CHANGE.indexOf(fieldName) !== -1;
} |
494 | ddd583e1dccec05881b3588518853a83 | swh:1:cnt:ca275c8156f1c4b5f6c36475f5ace6f93694025e;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=44-66/ | e3cb22f463ee6351df6e6982d70985ce90ab6442 | jsonschema-tools | analytics | lib/tests/compatibility.js | assertEnumCompatible | function | /**
* Asserts that newEnum is a superset of oldEnum
* @param {Array} newEnum
* @param {Array} oldEnum
* @param {string} path
*/
function assertEnumCompatible(newEnum, oldEnum, path) {
if (oldEnum && !newEnum) {
throw new assert.AssertionError({
message: `Removed enum at: ${path}`,
... |
495 | 13423de9ef16cdc1600ddc6534dbdd6c | swh:1:cnt:ca275c8156f1c4b5f6c36475f5ace6f93694025e;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=26-42/ | e3cb22f463ee6351df6e6982d70985ce90ab6442 | jsonschema-tools | analytics | lib/tests/compatibility.js | assertRequiredCompatible | function | function assertRequiredCompatible(newRequired, oldRequired, path) {
if (oldRequired && !newRequired) {
throw new assert.AssertionError({
message: `Removed list of required properties at: ${path}`,
expected: oldRequired,
actual: newRequired
});
}
if (!_.is... |
496 | 1e3d90d9f5a099ed3d10a7e66bf2db64 | swh:1:cnt:ca275c8156f1c4b5f6c36475f5ace6f93694025e;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=123-170/ | e3cb22f463ee6351df6e6982d70985ce90ab6442 | jsonschema-tools | analytics | lib/tests/compatibility.js | assertCompatible | function | function assertCompatible(newSchema, oldSchema, path = '') {
if (typeof newSchema !== typeof oldSchema ||
Array.isArray(newSchema) !== Array.isArray(oldSchema)) {
throw new assert.AssertionError({
message: `Error at path: ${path}`,
expected: oldSchema,
actual: new... |
497 | 2ec0c51c8a9fe4a52393ba7496a68de8 | swh:1:cnt:ca275c8156f1c4b5f6c36475f5ace6f93694025e;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=68-121/ | e3cb22f463ee6351df6e6982d70985ce90ab6442 | jsonschema-tools | analytics | lib/tests/compatibility.js | assertUnchangingObjectElements | function | /**
* Asserts that the shape of objects elements in array and map types is unchanging.
* @param {Object} newSchema
* @param {Object} oldSchema
* @param {string} path
*/
function assertUnchangingObjectElements(newSchema, oldSchema, path) {
/**
* Asserts that the shape, size, and order of the elements are ... |
498 | 50175981de5eea5a85783d258780b4c8 | swh:1:cnt:ca275c8156f1c4b5f6c36475f5ace6f93694025e;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=177-212/ | e3cb22f463ee6351df6e6982d70985ce90ab6442 | jsonschema-tools | analytics | lib/tests/compatibility.js | declareTests | function | function declareTests(options = { logLevel: 'warn' }) {
options = jsonschemaTools.readConfig(options);
const allSchemas = jsonschemaTools.findSchemasByTitleAndMajor(options);
describe(`Schema Compatibility in Repository ${options.schemaBasePath}`, () => {
for (const title of Object.keys(allSchemas)... |
499 | 7b3d69dbe41a3f05053292cfee388cc3 | swh:1:cnt:a2941bf2395ef610fae003b4508aa77355bb32de;origin=https://gitlab.wikimedia.org/repos/data-engineering/jsonschema-tools.git;lines=11-14/ | e8f8e7c3e94ddb13e48204f4715c27c956168f13 | jsonschema-tools | analytics | lib/tests/index.js | allTests | function | function allTests(options = {}) {
options = jsonschemaTools.readConfig(options);
Object.values(repositoryTests).forEach(test => test(options));
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.