Skip to content

Commit 2a0a5f2

Browse files
authored
chore(unit-tests): fix granularities tests (#9192)
1 parent 6d30458 commit 2a0a5f2

File tree

6 files changed

+19
-9
lines changed

6 files changed

+19
-9
lines changed

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
**Check List**
2-
- [ ] Tests has been run in packages where changes made if available
2+
- [ ] Tests have been run in packages where changes made if available
33
- [ ] Linter has been run for changed code
44
- [ ] Tests for the changes have been added if not covered yet
55
- [ ] Docs have been added / updated if required

packages/cubejs-schema-compiler/test/integration/clickhouse/custom-granularities.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,11 @@ describe('Custom Granularities', () => {
4141
granularities:
4242
- name: half_year
4343
interval: 6 months
44+
origin: '2024-01-01' # to keep tests stable across time (year change, etc)
4445
- name: half_year_by_1st_april
4546
interval: 6 months
46-
offset: 3 months
47+
#offset: 3 months
48+
origin: '2024-04-01' # to keep tests stable across time (year change, etc)
4749
- name: two_weeks_by_friday
4850
interval: 2 weeks
4951
origin: '2024-08-23'

packages/cubejs-schema-compiler/test/integration/mssql/custom-granularities.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,11 @@ describe('Custom Granularities', () => {
3737
granularities:
3838
- name: half_year
3939
interval: 6 months
40+
origin: '2024-01-01' # to keep tests stable across time (year change, etc)
4041
- name: half_year_by_1st_april
4142
interval: 6 months
42-
offset: 3 months
43+
#offset: 3 months
44+
origin: '2024-04-01' # to keep tests stable across time (year change, etc)
4345
- name: two_weeks_by_friday
4446
interval: 2 weeks
4547
origin: '2024-08-23'

packages/cubejs-schema-compiler/test/integration/mysql/custom-granularities.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,11 @@ describe('Custom Granularities', () => {
3737
granularities:
3838
- name: half_year
3939
interval: 6 months
40+
origin: '2024-01-01' # to keep tests stable across time (year change, etc)
4041
- name: half_year_by_1st_april
4142
interval: 6 months
42-
offset: 3 months
43+
#offset: 3 months
44+
origin: '2024-04-01' # to keep tests stable across time (year change, etc)
4345
- name: two_weeks_by_friday
4446
interval: 2 weeks
4547
origin: '2024-08-23'

packages/cubejs-schema-compiler/test/integration/postgres/custom-granularities.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@ describe('Custom Granularities', () => {
3939
granularities:
4040
- name: half_year
4141
interval: 6 months
42+
origin: '2024-01-01' # to keep tests stable across time (year change, etc)
4243
- name: half_year_by_1st_april
4344
interval: 6 months
44-
offset: 3 months
45+
#offset: 3 months
46+
origin: '2024-04-01' # to keep tests stable across time (year change, etc)
4547
- name: two_weeks_by_friday
4648
interval: 2 weeks
4749
origin: '2024-08-23'

packages/cubejs-testing-drivers/fixtures/_schemas.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,13 @@
9292
"granularities": [
9393
{
9494
"name": "half_year",
95-
"interval": "6 months"
95+
"interval": "6 months",
96+
"origin": "2024-01-01"
9697
},
9798
{
9899
"name": "half_year_by_1st_april",
99100
"interval": "6 months",
100-
"offset": "3 months"
101+
"origin": "2024-04-01"
101102
},
102103
{
103104
"name": "two_mo_by_feb",
@@ -118,12 +119,13 @@
118119
"granularities": [
119120
{
120121
"name": "half_year",
121-
"interval": "6 months"
122+
"interval": "6 months",
123+
"origin": "2024-01-01"
122124
},
123125
{
124126
"name": "half_year_by_1st_april",
125127
"interval": "6 months",
126-
"offset": "3 months"
128+
"origin": "2024-04-01"
127129
},
128130
{
129131
"name": "two_mo_by_feb",

0 commit comments

Comments
 (0)