Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
blendb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
C3SL
blendb
Commits
a4f36ad1
There was a problem fetching the pipeline summary.
Commit
a4f36ad1
authored
7 years ago
by
Lucas Fernandes de Oliveira
Browse files
Options
Downloads
Plain Diff
Merge branch 'issue/40' into 'master'
Issue
#40
: Sort metrics, dimensions and views by alphabetical order in tests See merge request
!31
parents
edf43239
73463228
Branches
Branches containing commit
No related tags found
1 merge request
!31
Issue #40: Sort metrics, dimensions and views by alphabetical order in tests
Pipeline
#
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/core/engine.spec.ts
+3
-15
3 additions, 15 deletions
src/core/engine.spec.ts
test/scenario.ts
+20
-4
20 additions, 4 deletions
test/scenario.ts
with
23 additions
and
19 deletions
src/core/engine.spec.ts
+
3
−
15
View file @
a4f36ad1
...
...
@@ -30,21 +30,9 @@ import { engineScenario } from "../../test/scenario";
describe
(
"
engine class
"
,
()
=>
{
const
engine
=
new
Engine
();
const
met
=
engineScenario
.
metrics
.
sort
((
a
,
b
)
=>
{
const
aValue
=
parseInt
(
a
.
name
.
split
(
"
:
"
)[
1
],
10
);
const
bValue
=
parseInt
(
b
.
name
.
split
(
"
:
"
)[
1
],
10
);
return
aValue
-
bValue
;
});
const
dim
=
engineScenario
.
dimensions
.
sort
((
a
,
b
)
=>
{
const
aValue
=
parseInt
(
a
.
name
.
split
(
"
:
"
)[
1
],
10
);
const
bValue
=
parseInt
(
b
.
name
.
split
(
"
:
"
)[
1
],
10
);
return
aValue
-
bValue
;
});
const
subdim
=
engineScenario
.
subDimensions
.
sort
((
a
,
b
)
=>
{
const
aValue
=
parseInt
(
a
.
name
.
split
(
"
:
"
)[
1
],
10
);
const
bValue
=
parseInt
(
b
.
name
.
split
(
"
:
"
)[
1
],
10
);
return
aValue
-
bValue
;
});
const
met
=
engineScenario
.
metrics
;
const
dim
=
engineScenario
.
dimensions
;
const
subdim
=
engineScenario
.
subDimensions
;
const
views
=
engineScenario
.
views
;
met
.
forEach
((
item
)
=>
engine
.
addMetric
(
item
));
...
...
This diff is collapsed.
Click to expand it.
test/scenario.ts
+
20
−
4
View file @
a4f36ad1
...
...
@@ -63,9 +63,21 @@ interface DataCtrlScenario {
const
config
=
ConfigParser
.
parse
(
"
config/test.yaml
"
);
const
mets
=
config
.
metrics
;
const
dims
=
config
.
dimensions
;
const
views
=
config
.
views
;
const
mets
=
config
.
metrics
.
sort
((
a
,
b
)
=>
{
const
aValue
=
parseInt
(
a
.
name
.
split
(
"
:
"
)[
1
],
10
);
const
bValue
=
parseInt
(
b
.
name
.
split
(
"
:
"
)[
1
],
10
);
return
aValue
-
bValue
;
});
const
dims
=
config
.
dimensions
.
sort
((
a
,
b
)
=>
{
const
aValue
=
parseInt
(
a
.
name
.
split
(
"
:
"
)[
1
],
10
);
const
bValue
=
parseInt
(
b
.
name
.
split
(
"
:
"
)[
1
],
10
);
return
aValue
-
bValue
;
});
const
views
=
config
.
buildViews
.
sort
((
a
,
b
)
=>
{
const
aValue
=
parseInt
(
a
.
alias
.
split
(
"
"
)[
1
],
10
);
const
bValue
=
parseInt
(
b
.
alias
.
split
(
"
"
)[
1
],
10
);
return
aValue
-
bValue
;
}).
map
((
item
)
=>
item
.
view
);
const
filters
:
{
[
key
:
string
]:
Filter
}
=
{
"
dim:0:0
"
:
new
Filter
({
...
...
@@ -166,7 +178,11 @@ const subdims = [
parent
:
dims
[
1
],
relation
:
RelationType
.
DAY
})
];
].
sort
((
a
,
b
)
=>
{
const
aValue
=
parseInt
(
a
.
name
.
split
(
"
:
"
)[
1
],
10
);
const
bValue
=
parseInt
(
b
.
name
.
split
(
"
:
"
)[
1
],
10
);
return
aValue
-
bValue
;
});
const
dateSubDim
=
[
new
Dimension
({
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment