Skip to content

Commit

Permalink
[skip-changelog] Fixed integration test (#2164)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaglie committed May 2, 2023
1 parent 89368c9 commit ebdef4d
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 3 deletions.
8 changes: 5 additions & 3 deletions internal/integrationtest/core/core_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -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": "[email protected]",
"name": "test"
}
]
}

0 comments on commit ebdef4d

Please sign in to comment.