-
-
Notifications
You must be signed in to change notification settings - Fork 385
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
expose Incompatible properity in the API
- Loading branch information
1 parent
2a9a291
commit cc1bbab
Showing
8 changed files
with
78 additions
and
30 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -181,8 +181,8 @@ func TestCoreSearchNoArgs(t *testing.T) { | |
for _, v := range strings.Split(strings.TrimSpace(string(stdout)), "\n") { | ||
lines = append(lines, strings.Fields(strings.TrimSpace(v))) | ||
} | ||
// Check the presence of test:[email protected] | ||
require.Contains(t, lines, []string{"test:x86", "3.0.0", "test_core"}) | ||
// Check the absence of test:[email protected] because it contains incompatible deps | ||
require.NotContains(t, lines, []string{"test:x86", "3.0.0", "test_core"}) | ||
numPlatforms = len(lines) - 1 | ||
|
||
// same thing in JSON format, also check the number of platforms found is the same | ||
|
@@ -1143,4 +1143,22 @@ func TestCoreHavingIncompatibleDepTools(t *testing.T) { | |
_, stderr, err = cli.Run("core", "install", "incompatible_vendor:avr", additionalURLs) | ||
require.Error(t, err) | ||
require.Contains(t, string(stderr), "has no available releases for your OS") | ||
|
||
// Core search --all shows incompatible field when a version is incompatible | ||
stdout, _, err = cli.Run("core", "search", "--all", "--format", "json", additionalURLs) | ||
require.NoError(t, err) | ||
requirejson.Query(t, stdout, | ||
`[.[] | select(.id == "foo_vendor:avr") | {latest: .latest, incompatible: .incompatible}] | sort_by(.latest)`, | ||
`[ | ||
{"incompatible":null,"latest":"1.0.0"}, | ||
{"incompatible":null,"latest":"1.0.1"}, | ||
{"incompatible":true,"latest":"1.0.2"} | ||
]`, | ||
) | ||
|
||
// Core search shows latest compatible version | ||
stdout, _, err = cli.Run("core", "search", "--format", "json", additionalURLs) | ||
require.NoError(t, err) | ||
requirejson.Query(t, stdout, `.[] | select(.id == "foo_vendor:avr") | .latest`, `"1.0.1"`) | ||
requirejson.Query(t, stdout, `.[] | select(.id == "incompatible_vendor:avr") | .incompatible`, `true`) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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