Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Commit 377095e

Browse files
committed
Add godep importer integration tests
1 parent e6726da commit 377095e

File tree

12 files changed

+124
-2
lines changed

12 files changed

+124
-2
lines changed

cmd/dep/godep_config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,14 @@ func (g *godepFile) convert(projectName string, sm gps.SourceManager) (*dep.Mani
8181
}
8282

8383
func (g *godepFile) buildProjectConstraint(pkg godepPackage, sm gps.SourceManager) (pc gps.ProjectConstraint, err error) {
84-
pc.Ident = gps.ProjectIdentifier{ProjectRoot: gps.ProjectRoot(pkg.ImportPath), Source: pkg.ImportPath}
84+
pc.Ident = gps.ProjectIdentifier{ProjectRoot: gps.ProjectRoot(pkg.ImportPath)}
8585
pc.Constraint, err = deduceConstraint(pkg.Comment, pc.Ident, sm)
8686
return
8787
}
8888

8989
func (g *godepFile) buildLockedProject(pkg godepPackage, manifest *dep.Manifest) gps.LockedProject {
9090
var ver gps.Version
91-
id := gps.ProjectIdentifier{ProjectRoot: gps.ProjectRoot(pkg.ImportPath), Source: pkg.ImportPath}
91+
id := gps.ProjectIdentifier{ProjectRoot: gps.ProjectRoot(pkg.ImportPath)}
9292
c, has := manifest.Dependencies[id.ProjectRoot]
9393
if has {
9494
// Create PairedVersion if constraint details are available

cmd/dep/import_analyzer.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ func newImportAnalyzer(loggers *dep.Loggers, sm gps.SourceManager) importAnalyze
2929
func (a importAnalyzer) importManifestAndLock(dir string, pr gps.ProjectRoot) (*dep.Manifest, *dep.Lock, error) {
3030
importers := []importer{
3131
newGlideImporter(a.loggers, a.sm),
32+
newGodepImporter(a.loggers, a.sm),
3233
}
3334

3435
for _, i := range importers {

cmd/dep/testdata/harness_tests/init/godep/case1/final/Gopkg.lock

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
[[dependencies]]
3+
branch = "master"
4+
name = "github.com/sdboyer/deptest"
5+
6+
[[dependencies]]
7+
name = "github.com/sdboyer/deptestdos"
8+
version = "^2.0.0"

cmd/dep/testdata/harness_tests/init/godep/case1/initial/Godeps/Godeps.json

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright 2017 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
package main
6+
7+
import (
8+
"fmt"
9+
10+
"github.com/sdboyer/deptestdos"
11+
)
12+
13+
func main() {
14+
var x deptestdos.Bar
15+
fmt.Println(x)
16+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"commands": [
3+
["init", "-no-examples"]
4+
],
5+
"error-expected": "",
6+
"gopath-initial": {
7+
"github.com/sdboyer/deptest": "3f4c3bea144e112a69bbe5d8d01c1b09a544253f"
8+
},
9+
"vendor-final": [
10+
"github.com/sdboyer/deptest",
11+
"github.com/sdboyer/deptestdos"
12+
]
13+
}

cmd/dep/testdata/harness_tests/init/godep/case2/final/Gopkg.lock

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
[[dependencies]]
3+
name = "github.com/sdboyer/deptestdos"
4+
version = "^2.0.0"

cmd/dep/testdata/harness_tests/init/godep/case2/initial/Godeps/Godeps.json

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright 2017 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
package main
6+
7+
import (
8+
"fmt"
9+
10+
"github.com/sdboyer/deptestdos"
11+
)
12+
13+
func main() {
14+
var x deptestdos.Bar
15+
fmt.Println(x)
16+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"commands": [
3+
["init", "-no-examples", "-skip-tools"]
4+
],
5+
"error-expected": "",
6+
"gopath-initial": {},
7+
"vendor-final": [
8+
"github.com/sdboyer/deptest",
9+
"github.com/sdboyer/deptestdos"
10+
]
11+
}

0 commit comments

Comments
 (0)