good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
U
upper
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
open
upper
Commits
3a022d95
Commit
3a022d95
authored
May 5, 2014
by
José Carlos Nieto
Browse files
Options
Downloads
Patches
Plain Diff
Adding the ability to test an specific wrapper with go test -wrapper.
parent
84a36c49
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.travis.yml
+6
-5
6 additions, 5 deletions
.travis.yml
db_test.go
+12
-1
12 additions, 1 deletion
db_test.go
with
18 additions
and
6 deletions
.travis.yml
+
6
−
5
View file @
3a022d95
...
...
@@ -12,11 +12,12 @@ install:
-
sudo apt-get install bzr
# - go get github.com/cznic/ql/ql # ql command line util.
# - go install github.com/cznic/ql/ql # ql command line util.
-
go get upper.io/db/mongo
-
go get upper.io/db/mysql
-
go get upper.io/db/postgresql
-
go get upper.io/db/sqlite
-
go get upper.io/db/ql
-
go get -t -d
# - go get upper.io/db/mongo
# - go get upper.io/db/mysql
# - go get upper.io/db/postgresql
# - go get upper.io/db/sqlite
# - go get upper.io/db/ql
services
:
-
mongodb
...
...
This diff is collapsed.
Click to expand it.
db_test.go
+
12
−
1
View file @
3a022d95
...
...
@@ -5,6 +5,7 @@ import (
"errors"
"flag"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
"log"
"reflect"
"testing"
...
...
@@ -25,6 +26,10 @@ var wrappers = []string{
`ql`
,
}
const
(
TestAllWrappers
=
`all`
)
var
(
errDriverErr
=
errors
.
New
(
`Driver error`
)
)
...
...
@@ -35,6 +40,7 @@ func init() {
// Getting host from the environment.
host
:=
flag
.
String
(
"host"
,
"testserver.local"
,
"Testing server address."
)
wrapper
:=
flag
.
String
(
"wrapper"
,
"all"
,
"Wrappers to test."
)
flag
.
Parse
()
...
...
@@ -67,6 +73,11 @@ func init() {
},
}
if
*
wrapper
!=
TestAllWrappers
{
wrappers
=
[]
string
{
*
wrapper
}
log
.
Printf
(
"Testing wrapper %s."
,
*
wrapper
)
}
}
var
setupFn
=
map
[
string
]
func
(
driver
interface
{})
error
{
...
...
@@ -331,7 +342,7 @@ func TestSimpleCRUD(t *testing.T) {
var
res
db
.
Result
switch
wrapper
{
case
`mongo`
:
res
=
col
.
Find
(
db
.
Cond
{
"_id"
:
id
})
res
=
col
.
Find
(
db
.
Cond
{
"_id"
:
id
.
(
bson
.
ObjectId
)
})
case
`ql`
:
res
=
col
.
Find
(
db
.
Cond
{
"id()"
:
id
})
default
:
...
...
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