Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
tank
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
AURA
tank
Commits
dc407870
Commit
dc407870
authored
6 years ago
by
Christian Pointner
Browse files
Options
Downloads
Patches
Plain Diff
fix store testcases
parent
ac7a27fc
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cmd/tank/main.go
+25
-0
25 additions, 0 deletions
cmd/tank/main.go
store/store_test.go
+3
-3
3 additions, 3 deletions
store/store_test.go
with
28 additions
and
3 deletions
cmd/tank/main.go
+
25
−
0
View file @
dc407870
...
...
@@ -87,6 +87,26 @@ func openStoreAndImporter(conf *Config) (st *store.Store, im *importer.Importer,
return
}
func
cmdTest
(
c
*
cli
.
Context
)
error
{
conf
,
err
:=
ReadConfig
(
c
.
GlobalString
(
"config"
))
if
err
!=
nil
{
return
cli
.
NewExitError
(
err
.
Error
(),
1
)
}
st
,
err
:=
store
.
NewStore
(
conf
.
Store
)
if
err
!=
nil
{
return
cli
.
NewExitError
(
err
.
Error
(),
1
)
}
groups
,
err
:=
st
.
ListGroups
()
if
err
!=
nil
{
return
cli
.
NewExitError
(
err
.
Error
(),
1
)
}
infoLog
.
Printf
(
"groups: %v"
,
groups
)
return
cli
.
NewExitError
(
""
,
0
)
}
func
cmdRun
(
c
*
cli
.
Context
)
error
{
infoLog
.
Println
(
"starting..."
)
...
...
@@ -160,6 +180,11 @@ func main() {
Usage
:
"initialize the store"
,
Action
:
cmdInit
,
},
{
Name
:
"test"
,
Usage
:
"run some tests"
,
Action
:
cmdTest
,
},
{
Name
:
"run"
,
Usage
:
"run the daemon"
,
...
...
This diff is collapsed.
Click to expand it.
store/store_test.go
+
3
−
3
View file @
dc407870
...
...
@@ -69,7 +69,7 @@ func TestMain(m *testing.M) {
func
TestOpen
(
t
*
testing
.
T
)
{
// base-path is non-existing directory
cfg
:=
&
Config
{}
cfg
:=
Config
{}
cfg
.
BasePath
=
"/nonexistend/"
cfg
.
DB
.
Type
=
testDBType
cfg
.
DB
.
Connection
=
testDBConnection
...
...
@@ -108,7 +108,7 @@ func TestOpen(t *testing.T) {
}
func
TestMigrations
(
t
*
testing
.
T
)
{
cfg
:=
&
Config
{}
cfg
:=
Config
{}
cfg
.
BasePath
=
testBasePath
cfg
.
DB
.
Type
=
testDBType
cfg
.
DB
.
Connection
=
testDBConnection
...
...
@@ -169,7 +169,7 @@ func TestMigrations(t *testing.T) {
//
func
TestGroups
(
t
*
testing
.
T
)
{
cfg
:=
&
Config
{}
cfg
:=
Config
{}
cfg
.
BasePath
=
testBasePath
cfg
.
DB
.
Type
=
testDBType
cfg
.
DB
.
Connection
=
testDBConnection
...
...
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