diff --git a/internal/integrationtest/core/core_test.go b/internal/integrationtest/core/core_test.go index 7b9c4aaedf8..55030c1d316 100644 --- a/internal/integrationtest/core/core_test.go +++ b/internal/integrationtest/core/core_test.go @@ -996,15 +996,17 @@ func TestCoreInstallRunsToolPostInstallScript(t *testing.T) { env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t) defer env.CleanUp() - url := "http://drazzy.com/package_drazzy.com_index.json" + url := env.HTTPServeFile(8080, paths.New("testdata", "package_with_postinstall_index.json")) + env.HTTPServeFile(8081, paths.New("testdata", "core_with_postinst.zip")) - _, _, err := cli.Run("core", "update-index", "--additional-urls", url) + _, _, err := cli.Run("core", "update-index", "--additional-urls", url.String()) require.NoError(t, err) // Checks that the post_install script is correctly skipped on the CI - stdout, _, err := cli.Run("core", "install", "ATTinyCore:avr", "--verbose", "--additional-urls", url) + stdout, _, err := cli.Run("core", "install", "Test:x86", "--additional-urls", url.String()) require.NoError(t, err) require.Contains(t, string(stdout), "Skipping tool configuration.") + require.Contains(t, string(stdout), "Skipping platform configuration.") } func TestCoreBrokenDependency(t *testing.T) { diff --git a/internal/integrationtest/core/testdata/core_with_postinst.zip b/internal/integrationtest/core/testdata/core_with_postinst.zip new file mode 100644 index 00000000000..4855bc84a45 Binary files /dev/null and b/internal/integrationtest/core/testdata/core_with_postinst.zip differ diff --git a/internal/integrationtest/core/testdata/package_with_postinstall_index.json b/internal/integrationtest/core/testdata/package_with_postinstall_index.json new file mode 100644 index 00000000000..7521acb12dd --- /dev/null +++ b/internal/integrationtest/core/testdata/package_with_postinstall_index.json @@ -0,0 +1,41 @@ +{ + "packages": [ + { + "maintainer": "Test", + "help": { + "online": "https://github.com/Arduino/arduino-cli" + }, + "websiteURL": "https://github.com/Arduino/arduino-cli", + "platforms": [ + { + "category": "Test Category", + "help": { + "online": "https://github.com/Arduino/arduino-cli" + }, + "url": "http://127.0.0.1:8081/core_with_postinst.zip", + "checksum": "SHA-256:b08f89eae117254f01215082a2504d94ab28560a7bf944f0b5dcd2772a8f0b7e", + "name": "test_core", + "version": "2.0.0", + "architecture": "x86", + "archiveFileName": "core.zip", + "size": "828", + "toolsDependencies": [ + { + "packager": "arduino", + "version": "6.3.0-arduino17", + "name": "avrdude" + } + ], + "boards": [ + { + "name": "Test Board" + } + ] + } + ], + "tools": [], + "email": "test@example.com", + "name": "test" + } + ] +}