-
-
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.
cr: remove
latest_compatible_version
from gRPC api.
We leave only the `latest_compatible` field from the API. This field will have the same meaning the the former `latest_compatible_version`. Meaning that if the `latest_compatible` contains a version it is a release that can be installed. However it might happen that we have newer releases that cannot be installed. If the client is interested to show newer-non-installable-releases, the `releases` field can be used to infer that.
- Loading branch information
1 parent
d3c7d95
commit 679f014
Showing
13 changed files
with
177 additions
and
204 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,41 +80,19 @@ func TestPlatformSearch(t *testing.T) { | |
}, | ||
}, | ||
InstalledVersion: "", | ||
LatestVersion: "1.0.6", | ||
}) | ||
}) | ||
|
||
t.Run("SearchNoAllVersions", func(t *testing.T) { | ||
// This platform doesn't contain any installable release | ||
res, stat := PlatformSearch(&rpc.PlatformSearchRequest{ | ||
Instance: inst, | ||
SearchArgs: "retrokit", | ||
AllVersions: false, | ||
}) | ||
require.Nil(t, stat) | ||
require.NotNil(t, res) | ||
require.Len(t, res.SearchOutput, 1) | ||
require.Contains(t, res.SearchOutput, &rpc.PlatformSummary{ | ||
Metadata: &rpc.PlatformMetadata{ | ||
Id: "Retrokits-RK002:arm", | ||
Maintainer: "Retrokits (www.retrokits.com)", | ||
Website: "https://www.retrokits.com", | ||
Email: "[email protected]", | ||
Indexed: true, | ||
}, | ||
Releases: map[string]*rpc.PlatformRelease{ | ||
"1.0.6": { | ||
Name: "RK002", | ||
Type: []string{"Contributed"}, | ||
Installed: false, | ||
Version: "1.0.6", | ||
Boards: []*rpc.Board{{Name: "RK002"}}, | ||
Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, | ||
Compatible: false, | ||
}, | ||
}, | ||
InstalledVersion: "", | ||
LatestVersion: "1.0.6", | ||
}) | ||
require.Empty(t, res.SearchOutput) | ||
}) | ||
|
||
t.Run("SearchThePackageMaintainer", func(t *testing.T) { | ||
|
@@ -155,7 +133,6 @@ func TestPlatformSearch(t *testing.T) { | |
}, | ||
}, | ||
InstalledVersion: "", | ||
LatestVersion: "1.0.6", | ||
}) | ||
}) | ||
|
||
|
@@ -197,7 +174,6 @@ func TestPlatformSearch(t *testing.T) { | |
}, | ||
}, | ||
InstalledVersion: "", | ||
LatestVersion: "1.0.6", | ||
}) | ||
}) | ||
|
||
|
@@ -239,7 +215,6 @@ func TestPlatformSearch(t *testing.T) { | |
}, | ||
}, | ||
InstalledVersion: "", | ||
LatestVersion: "1.0.6", | ||
}) | ||
}) | ||
|
||
|
@@ -299,7 +274,6 @@ func TestPlatformSearch(t *testing.T) { | |
}, | ||
}, | ||
InstalledVersion: "", | ||
LatestVersion: "1.8.3", | ||
}) | ||
}) | ||
|
||
|
@@ -359,7 +333,6 @@ func TestPlatformSearch(t *testing.T) { | |
}, | ||
}, | ||
InstalledVersion: "", | ||
LatestVersion: "1.8.3", | ||
}) | ||
}) | ||
} | ||
|
@@ -383,15 +356,15 @@ func TestPlatformSearchSorting(t *testing.T) { | |
res, stat := PlatformSearch(&rpc.PlatformSearchRequest{ | ||
Instance: inst, | ||
SearchArgs: "", | ||
AllVersions: false, | ||
AllVersions: true, | ||
}) | ||
require.Nil(t, stat) | ||
require.NotNil(t, res) | ||
|
||
require.Len(t, res.SearchOutput, 3) | ||
require.Equal(t, res.SearchOutput[0].GetLatestRelease().Name, "Arduino AVR Boards") | ||
require.Equal(t, res.SearchOutput[0].GetSortedReleases()[0].Name, "Arduino AVR Boards") | ||
require.Equal(t, res.SearchOutput[0].Metadata.Deprecated, false) | ||
require.Equal(t, res.SearchOutput[1].GetLatestRelease().Name, "RK002") | ||
require.Equal(t, res.SearchOutput[1].GetSortedReleases()[0].Name, "RK002") | ||
require.Equal(t, res.SearchOutput[1].Metadata.Deprecated, false) | ||
require.Equal(t, res.SearchOutput[2].GetLatestRelease().Name, "Platform") | ||
require.Equal(t, res.SearchOutput[2].Metadata.Deprecated, true) | ||
|
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
Oops, something went wrong.