This repository has been archived by the owner on Sep 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
API docs: add tests & fix issue indexing illegal moby/moby Go code (#189
) * API docs: add test for failure to index moby/moby illegal Go code * CHANGELOG: add v1.6.6 entry Signed-off-by: Stephen Gutekanst <[email protected]>
- Loading branch information
Stephen Gutekanst
authored
Aug 13, 2021
1 parent
f53d65f
commit 6860e46
Showing
9 changed files
with
350 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
181 changes: 181 additions & 0 deletions
181
internal/indexer/testdata/TestIndexer_documentation/testdata/conflicting_test_symbols.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,181 @@ | ||
{ | ||
"pathID": "/conflicting_test_symbols", | ||
"documentation": { | ||
"identifier": "conflicting_test_symbols", | ||
"newPage": true, | ||
"searchKey": "conflicting_test_symbols", | ||
"tags": [ | ||
"private", | ||
"package" | ||
] | ||
}, | ||
"label": { | ||
"kind": "plaintext", | ||
"value": "Package osl" | ||
}, | ||
"detail": { | ||
"kind": "markdown", | ||
"value": "" | ||
}, | ||
"children": [ | ||
{ | ||
"node": { | ||
"pathID": "/conflicting_test_symbols#var", | ||
"documentation": { | ||
"identifier": "var", | ||
"newPage": false, | ||
"searchKey": "", | ||
"tags": [ | ||
"private" | ||
] | ||
}, | ||
"label": { | ||
"kind": "plaintext", | ||
"value": "Variables" | ||
}, | ||
"detail": { | ||
"kind": "plaintext", | ||
"value": "" | ||
}, | ||
"children": [ | ||
{ | ||
"node": { | ||
"pathID": "/conflicting_test_symbols#ErrNotImplemented", | ||
"documentation": { | ||
"identifier": "ErrNotImplemented", | ||
"newPage": false, | ||
"searchKey": "osl.ErrNotImplemented", | ||
"tags": [ | ||
"variable", | ||
"interface" | ||
] | ||
}, | ||
"label": { | ||
"kind": "plaintext", | ||
"value": "var ErrNotImplemented" | ||
}, | ||
"detail": { | ||
"kind": "markdown", | ||
"value": "```Go\nvar ErrNotImplemented = errors.New(\"not implemented\")\n```\n\nErrNotImplemented is for platforms which don't implement sandbox \n\n" | ||
}, | ||
"children": null | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"node": { | ||
"pathID": "/conflicting_test_symbols#func", | ||
"documentation": { | ||
"identifier": "func", | ||
"newPage": false, | ||
"searchKey": "", | ||
"tags": [ | ||
"private" | ||
] | ||
}, | ||
"label": { | ||
"kind": "plaintext", | ||
"value": "Functions" | ||
}, | ||
"detail": { | ||
"kind": "plaintext", | ||
"value": "" | ||
}, | ||
"children": [ | ||
{ | ||
"node": { | ||
"pathID": "/conflicting_test_symbols#GenerateKey", | ||
"documentation": { | ||
"identifier": "GenerateKey", | ||
"newPage": false, | ||
"searchKey": "osl.GenerateKey", | ||
"tags": [ | ||
"function" | ||
] | ||
}, | ||
"label": { | ||
"kind": "plaintext", | ||
"value": "func GenerateKey(containerID string) string" | ||
}, | ||
"detail": { | ||
"kind": "markdown", | ||
"value": "```Go\nfunc GenerateKey(containerID string) string\n```\n\nGenerateKey generates a sandbox key based on the passed container id. \n\n" | ||
}, | ||
"children": null | ||
} | ||
}, | ||
{ | ||
"node": { | ||
"pathID": "/conflicting_test_symbols#NewSandbox", | ||
"documentation": { | ||
"identifier": "NewSandbox", | ||
"newPage": false, | ||
"searchKey": "osl.NewSandbox", | ||
"tags": [ | ||
"function" | ||
] | ||
}, | ||
"label": { | ||
"kind": "plaintext", | ||
"value": "func NewSandbox(key string, osCreate, isRestore bool) (Sandbox, error)" | ||
}, | ||
"detail": { | ||
"kind": "markdown", | ||
"value": "```Go\nfunc NewSandbox(key string, osCreate, isRestore bool) (Sandbox, error)\n```\n\nNewSandbox provides a new sandbox instance created in an os specific way provided a key which uniquely identifies the sandbox \n\n" | ||
}, | ||
"children": null | ||
} | ||
}, | ||
{ | ||
"node": { | ||
"pathID": "/conflicting_test_symbols#newKey", | ||
"documentation": { | ||
"identifier": "newKey", | ||
"newPage": false, | ||
"searchKey": "osl.newKey", | ||
"tags": [ | ||
"function", | ||
"private" | ||
] | ||
}, | ||
"label": { | ||
"kind": "plaintext", | ||
"value": "func newKey(t *testing.T) (string, error)" | ||
}, | ||
"detail": { | ||
"kind": "markdown", | ||
"value": "```Go\nfunc newKey(t *testing.T) (string, error)\n```\n\n" | ||
}, | ||
"children": null | ||
} | ||
}, | ||
{ | ||
"node": { | ||
"pathID": "/conflicting_test_symbols#verifySandbox", | ||
"documentation": { | ||
"identifier": "verifySandbox", | ||
"newPage": false, | ||
"searchKey": "osl.verifySandbox", | ||
"tags": [ | ||
"function", | ||
"private" | ||
] | ||
}, | ||
"label": { | ||
"kind": "plaintext", | ||
"value": "func verifySandbox(t *testing.T, s Sandbox)" | ||
}, | ||
"detail": { | ||
"kind": "markdown", | ||
"value": "```Go\nfunc verifySandbox(t *testing.T, s Sandbox)\n```\n\n" | ||
}, | ||
"children": null | ||
} | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} |
86 changes: 86 additions & 0 deletions
86
...indexer/testdata/TestIndexer_documentation/testdata/conflicting_test_symbols.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# Package osl | ||
|
||
## Index | ||
|
||
* [Variables](#var) | ||
* [var ErrNotImplemented](#ErrNotImplemented) | ||
* [Functions](#func) | ||
* [func GenerateKey(containerID string) string](#GenerateKey) | ||
* [func NewSandbox(key string, osCreate, isRestore bool) (Sandbox, error)](#NewSandbox) | ||
* [func newKey(t *testing.T) (string, error)](#newKey) | ||
* [func verifySandbox(t *testing.T, s Sandbox)](#verifySandbox) | ||
|
||
|
||
## <a id="var" href="#var">Variables</a> | ||
|
||
``` | ||
tags: [private] | ||
``` | ||
|
||
### <a id="ErrNotImplemented" href="#ErrNotImplemented">var ErrNotImplemented</a> | ||
|
||
``` | ||
searchKey: osl.ErrNotImplemented | ||
tags: [variable interface] | ||
``` | ||
|
||
```Go | ||
var ErrNotImplemented = errors.New("not implemented") | ||
``` | ||
|
||
ErrNotImplemented is for platforms which don't implement sandbox | ||
|
||
## <a id="func" href="#func">Functions</a> | ||
|
||
``` | ||
tags: [private] | ||
``` | ||
|
||
### <a id="GenerateKey" href="#GenerateKey">func GenerateKey(containerID string) string</a> | ||
|
||
``` | ||
searchKey: osl.GenerateKey | ||
tags: [function] | ||
``` | ||
|
||
```Go | ||
func GenerateKey(containerID string) string | ||
``` | ||
|
||
GenerateKey generates a sandbox key based on the passed container id. | ||
|
||
### <a id="NewSandbox" href="#NewSandbox">func NewSandbox(key string, osCreate, isRestore bool) (Sandbox, error)</a> | ||
|
||
``` | ||
searchKey: osl.NewSandbox | ||
tags: [function] | ||
``` | ||
|
||
```Go | ||
func NewSandbox(key string, osCreate, isRestore bool) (Sandbox, error) | ||
``` | ||
|
||
NewSandbox provides a new sandbox instance created in an os specific way provided a key which uniquely identifies the sandbox | ||
|
||
### <a id="newKey" href="#newKey">func newKey(t *testing.T) (string, error)</a> | ||
|
||
``` | ||
searchKey: osl.newKey | ||
tags: [function private] | ||
``` | ||
|
||
```Go | ||
func newKey(t *testing.T) (string, error) | ||
``` | ||
|
||
### <a id="verifySandbox" href="#verifySandbox">func verifySandbox(t *testing.T, s Sandbox)</a> | ||
|
||
``` | ||
searchKey: osl.verifySandbox | ||
tags: [function private] | ||
``` | ||
|
||
```Go | ||
func verifySandbox(t *testing.T, s Sandbox) | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1131,6 +1131,9 @@ | |
] | ||
} | ||
}, | ||
{ | ||
"pathID": "/conflicting_test_symbols" | ||
}, | ||
{ | ||
"pathID": "/duplicate_path_id" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
internal/testdata/conflicting_test_symbols/sandbox_unsupported.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// From https://github.com/moby/moby/blob/master/libnetwork/osl/sandbox_unsupported.go | ||
// Build tag constraints removed here to ensure this code is tested on CI. | ||
|
||
package osl | ||
|
||
import "errors" | ||
|
||
var ( | ||
// ErrNotImplemented is for platforms which don't implement sandbox | ||
ErrNotImplemented = errors.New("not implemented") | ||
) | ||
|
||
// NewSandbox provides a new sandbox instance created in an os specific way | ||
// provided a key which uniquely identifies the sandbox | ||
func NewSandbox(key string, osCreate, isRestore bool) (Sandbox, error) { | ||
return nil, ErrNotImplemented | ||
} | ||
|
||
// GenerateKey generates a sandbox key based on the passed | ||
// container id. | ||
func GenerateKey(containerID string) string { | ||
return "" | ||
} |
Oops, something went wrong.