Skip to content

Commit ebdef4d

Browse files
authored
[skip-changelog] Fixed integration test (#2164)
1 parent 89368c9 commit ebdef4d

File tree

3 files changed

+46
-3
lines changed

3 files changed

+46
-3
lines changed

Diff for: internal/integrationtest/core/core_test.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -996,15 +996,17 @@ func TestCoreInstallRunsToolPostInstallScript(t *testing.T) {
996996
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
997997
defer env.CleanUp()
998998

999-
url := "http://drazzy.com/package_drazzy.com_index.json"
999+
url := env.HTTPServeFile(8080, paths.New("testdata", "package_with_postinstall_index.json"))
1000+
env.HTTPServeFile(8081, paths.New("testdata", "core_with_postinst.zip"))
10001001

1001-
_, _, err := cli.Run("core", "update-index", "--additional-urls", url)
1002+
_, _, err := cli.Run("core", "update-index", "--additional-urls", url.String())
10021003
require.NoError(t, err)
10031004

10041005
// Checks that the post_install script is correctly skipped on the CI
1005-
stdout, _, err := cli.Run("core", "install", "ATTinyCore:avr", "--verbose", "--additional-urls", url)
1006+
stdout, _, err := cli.Run("core", "install", "Test:x86", "--additional-urls", url.String())
10061007
require.NoError(t, err)
10071008
require.Contains(t, string(stdout), "Skipping tool configuration.")
1009+
require.Contains(t, string(stdout), "Skipping platform configuration.")
10081010
}
10091011

10101012
func TestCoreBrokenDependency(t *testing.T) {
828 Bytes
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"packages": [
3+
{
4+
"maintainer": "Test",
5+
"help": {
6+
"online": "https://github.com/Arduino/arduino-cli"
7+
},
8+
"websiteURL": "https://github.com/Arduino/arduino-cli",
9+
"platforms": [
10+
{
11+
"category": "Test Category",
12+
"help": {
13+
"online": "https://github.com/Arduino/arduino-cli"
14+
},
15+
"url": "http://127.0.0.1:8081/core_with_postinst.zip",
16+
"checksum": "SHA-256:b08f89eae117254f01215082a2504d94ab28560a7bf944f0b5dcd2772a8f0b7e",
17+
"name": "test_core",
18+
"version": "2.0.0",
19+
"architecture": "x86",
20+
"archiveFileName": "core.zip",
21+
"size": "828",
22+
"toolsDependencies": [
23+
{
24+
"packager": "arduino",
25+
"version": "6.3.0-arduino17",
26+
"name": "avrdude"
27+
}
28+
],
29+
"boards": [
30+
{
31+
"name": "Test Board"
32+
}
33+
]
34+
}
35+
],
36+
"tools": [],
37+
"email": "[email protected]",
38+
"name": "test"
39+
}
40+
]
41+
}

0 commit comments

Comments
 (0)