Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
44981a2
Migrate TestCompileWithLibrary from test_compile_part_4.py to compile…
MatteoPologruto Sep 30, 2022
c6ea437
Migrate TestCompileWithLibraryPriority from test_compile_part_4.py to…
MatteoPologruto Sep 30, 2022
560baa3
Migrate TestRecompileWithDifferentLibrary from test_compile_part_4.py…
MatteoPologruto Sep 30, 2022
266723e
Migrate TestCompileWithConflictingLibrariesInclude from test_compile_…
MatteoPologruto Sep 30, 2022
28d1020
Migrate TestCompileWithInvalidBuildOptionJson from test_compile_part_…
MatteoPologruto Sep 30, 2022
e072c98
Migrate TestCompileWithEsp32BundledLibraries from test_compile_part_4…
MatteoPologruto Sep 30, 2022
9ca8a7b
Migrate TestCompileWithEsp8266BundledLibraries from test_compile_part…
MatteoPologruto Sep 30, 2022
116bfd9
Migrate TestGenerateCompileCommandsJsonResilience from test_compile_p…
MatteoPologruto Sep 30, 2022
53fb571
Migrate TestCompileSketchWithTppFileInclude from test_compile_part_4.…
MatteoPologruto Sep 30, 2022
bfacc80
Migrate TestCompileSketchWithIppFileInclude from test_compile_part_4.…
MatteoPologruto Sep 30, 2022
34b9f78
Migrate TestCompileWithoutUploadAndFqbn from test_compile_part_4.py t…
MatteoPologruto Sep 30, 2022
2b2f491
Migrate TestCompileNonInstalledPlatformWithWrongPackagerAndArch from …
MatteoPologruto Sep 30, 2022
79961f1
Migrate TestCompileWithKnownPlatformNotInstalled from test_compile_pa…
MatteoPologruto Sep 30, 2022
0e32825
Migrate TestCompileManuallyInstalledPlatformUsingBoardsLocalTxt from …
MatteoPologruto Oct 5, 2022
9cc05ac
Migrate TestCompileWithRelativeBuildPath from test_compile_part_4.py …
MatteoPologruto Oct 5, 2022
d145c30
Migrate TestCompileWithFakeSecureBootCore to compile_part_4_test.go a…
MatteoPologruto Oct 6, 2022
517a54e
Rearrange compile tests to share the same environment
MatteoPologruto Oct 14, 2022
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
Prev Previous commit
Next Next commit
Migrate TestCompileWithKnownPlatformNotInstalled from test_compile_pa…
…rt_4.py to compile_part_4_test.go
  • Loading branch information
MatteoPologruto committed Nov 10, 2022
commit 79961f1da59bcbc99a3918a5058c37fdc1bf384f
20 changes: 20 additions & 0 deletions internal/integrationtest/compile/compile_part_4_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,3 +444,23 @@ func TestCompileNonInstalledPlatformWithWrongPackagerAndArch(t *testing.T) {
require.Contains(t, string(stderr), "Error during build: Platform 'arduino:wrong' not found: platform not installed")
require.Contains(t, string(stderr), "Platform arduino:wrong is not found in any known index")
}

func TestCompileWithKnownPlatformNotInstalled(t *testing.T) {
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
defer env.CleanUp()

_, _, err := cli.Run("update")
require.NoError(t, err)

// Create a sketch
sketchPath := cli.SketchbookDir().Join("SketchSimple")
_, _, err = cli.Run("sketch", "new", sketchPath.String())
require.NoError(t, err)

// Try to compile using a platform found in the index but not installed
_, stderr, err := cli.Run("compile", "-b", "arduino:avr:uno", sketchPath.String())
require.Error(t, err)
require.Contains(t, string(stderr), "Error during build: Platform 'arduino:avr' not found: platform not installed")
// Verifies command to fix error is shown to user
require.Contains(t, string(stderr), "Try running `arduino-cli core install arduino:avr`")
}
16 changes: 0 additions & 16 deletions test/test_compile_part_4.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,22 +83,6 @@ def test_compile_with_relative_build_path(run_command, data_dir, copy_sketch):
assert "sketch" in built_files


def test_compile_with_known_platform_not_installed(run_command, data_dir):
assert run_command(["update"])

# Create a sketch
sketch_name = "SketchSimple"
sketch_path = Path(data_dir, sketch_name)
assert run_command(["sketch", "new", sketch_path])

# Try to compile using a platform found in the index but not installed
res = run_command(["compile", "-b", "arduino:avr:uno", sketch_path])
assert res.failed
assert "Error during build: Platform 'arduino:avr' not found: platform not installed" in res.stderr
# Verifies command to fix error is shown to user
assert "Try running `arduino-cli core install arduino:avr`" in res.stderr


def test_compile_with_fake_secure_boot_core(run_command, data_dir):
assert run_command(["update"])

Expand Down