Skip to content

Commit

Permalink
[skip-changelog] test: Fixed runners not running 'board' integration …
Browse files Browse the repository at this point in the history
…test (#2381)

* test: Fixed runners not running 'board' integration test

* Fixed integration test

* Fixed integration test failure:

<<< Run completed (err = <nil>)
    environment.go:52:
        	Error Trace:	D:/a/arduino-cli/arduino-cli/internal/integrationtest/environment.go:52
            			D:/a/arduino-cli/arduino-cli/internal/integrationtest/environment.go:63
        	            	D:/a/arduino-cli/arduino-cli/internal/integrationtest/environment.go:63
        	            	D:/a/arduino-cli/arduino-cli/internal/integrationtest/environment.go:69
        	            	D:/a/arduino-cli/arduino-cli/internal/integrationtest/board/board_test.go:638
        	Error:      	Received unexpected error:
        	            	remove C:\Users\runneradmin\AppData\Local\Temp\cli2634248494\A\inventory.yaml: The process cannot access the file because it is being used by another process.
        	Test:       	TestCLIStartupWithCorruptedInventory
--- FAIL: TestCLIStartupWithCorruptedInventory (8.45s)
  • Loading branch information
cmaglie authored Nov 10, 2023
1 parent b0e28d9 commit ae24226
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/test-go-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ jobs:

- name: Collect tests
id: collection
# jq flags must be "-cRn" see: https://stackoverflow.com/a/68859958/1655275
run: |
echo "tests-data=$(go list ./internal/integrationtest/... | grep integrationtest/ | tr "/" " " | cut -d " " -f 6 | jq -cR '[inputs]')" >> $GITHUB_OUTPUT
echo "tests-data=$(go list ./internal/integrationtest/... | grep integrationtest/ | tr "/" " " | cut -d " " -f 6 | jq -cRn '[inputs]')" >> $GITHUB_OUTPUT
test-integration:
needs: tests-collector
Expand Down
1 change: 1 addition & 0 deletions internal/integrationtest/board/board_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ func TestCLIStartupWithCorruptedInventory(t *testing.T) {
require.NoError(t, err)
_, err = f.WriteString(`data: '[{"name":"WCH;32?'","fqbn":"esp32:esp32:esp32s3camlcd"}]'`)
require.NoError(t, err)
require.NoError(t, f.Close())

// the CLI should not be able to load inventory and report it to the logs
_, stderr, err := cli.Run("core", "update-index", "-v")
Expand Down
7 changes: 1 addition & 6 deletions internal/integrationtest/board/hardware_loading_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,7 @@ func TestHardwareLoading(t *testing.T) {
out, _, err := cli.Run("core", "list", "--format", "json")
require.NoError(t, err)
jsonOut := requirejson.Parse(t, out)
if runtime.GOOS == "windows" {
// a package is a symlink, and windows does not support them
jsonOut.LengthMustEqualTo(2)
} else {
jsonOut.LengthMustEqualTo(3)
}
jsonOut.LengthMustEqualTo(3)
jsonOut.MustContain(`[
{
"id": "arduino:avr",
Expand Down

0 comments on commit ae24226

Please sign in to comment.