Skip to content

Manually installed platforms are now shown in core search output #1151

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion commands/core/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func PlatformSearch(instanceID int32, searchArgs string, allVersions bool) (*rpc
for _, targetPackage := range pm.Packages {
for _, platform := range targetPackage.Platforms {
// discard invalid platforms
if platform == nil || platform.Name == "" {
if platform == nil {
continue
}

Expand Down
22 changes: 22 additions & 0 deletions test/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import simplejson as json
import tempfile
import hashlib
from git import Repo
from pathlib import Path


Expand Down Expand Up @@ -363,3 +364,24 @@ def test_core_update_with_local_url(run_command):
res = run_command(f'core update-index --additional-urls="file://{test_index}"')
assert res.ok
assert "Updating index: test_index.json downloaded" in res.stdout


def test_core_search_list_manually_installed_cores(run_command, data_dir):
assert run_command("core update-index")

# Verifies only cores in
res = run_command("core search --format json")
assert res.ok
cores = json.loads(res.stdout)
assert len(cores) == 17

# Manually installs a core in sketchbooks hardware folder
git_url = "https://github.com/arduino/ArduinoCore-avr.git"
repo_dir = Path(data_dir, "hardware", "arduino-beta-development", "avr")
assert Repo.clone_from(git_url, repo_dir)

# Verifies manually installed core is correctly found
res = run_command("core search --format json")
assert res.ok
cores = json.loads(res.stdout)
assert len(cores) == 18