Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bye bye legacy! #2317

Merged
merged 8 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 0 additions & 6 deletions .github/workflows/test-go-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,6 @@ jobs:
- name: Run tests
run: task go:test

- name: Run unit tests on the legacy package
# Run legacy tests on one platform only
if: runner.os == 'Linux'
run: task test-legacy

- name: Upload coverage data to workflow artifact
if: runner.os == 'Linux'
uses: actions/upload-artifact@v3
Expand All @@ -167,7 +162,6 @@ jobs:
name: ${{ env.COVERAGE_ARTIFACT }}
path: |
./coverage_unit.txt
./coverage_legacy.txt

coverage-upload:
runs-on: ubuntu-latest
Expand Down
24 changes: 4 additions & 20 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -284,21 +284,11 @@ tasks:
- task: go:build

test:
desc: Run the full testsuite, `legacy` will be skipped
desc: Run the full testsuite
cmds:
- task: go:test
- task: go:integration-test

test-legacy:
desc: Run tests for the `legacy` package
cmds:
- |
go test \
{{ default "-v -failfast" .GOFLAGS }} \
-coverprofile=coverage_legacy.txt \
./legacy/... \
{{.TEST_LDFLAGS}}

test-unit-race:
desc: Run unit tests only with race condition detection
cmds:
Expand All @@ -311,18 +301,12 @@ tasks:
{{.TEST_LDFLAGS}}

check:
desc: Check fmt and lint, `legacy` will be skipped
desc: Check fmt and lint
cmds:
- task: go:vet
- task: go:lint
- task: protoc:check

check-legacy:
desc: Check fmt and lint for the `legacy` package
cmds:
- test -z $(go fmt ./legacy/...)
- go vet ./legacy/...

rpc-client:
desc: Run the rpc client test routine (server must be already started)
cmds:
Expand Down Expand Up @@ -376,10 +360,10 @@ tasks:
vars:
PROJECT_NAME: "arduino-cli"
DIST_DIR: "dist"
# all modules of this project except for "legacy/..." module and integration test
# all modules of this project except for integration test
DEFAULT_GO_PACKAGES:
sh: |
echo $(cd {{default "./" .GO_MODULE_PATH}} && go list ./... | grep -v internal/integrationtest | grep -v legacy | tr '\n' ' ' || echo '"ERROR: Unable to discover Go packages"')
echo $(cd {{default "./" .GO_MODULE_PATH}} && go list ./... | grep -v internal/integrationtest | tr '\n' ' ' || echo '"ERROR: Unable to discover Go packages"')
DEFAULT_INTEGRATIONTEST_GO_PACKAGES:
sh: |
echo $(cd {{default "./" .GO_MODULE_PATH}} && go list ./... | grep internal/integrationtest | tr '\n' ' ' || echo '"ERROR: Unable to discover Go packages"')
Expand Down
8 changes: 5 additions & 3 deletions arduino/builder/build_options_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,16 @@ func (m *BuildOptionsManager) wipeBuildPath() error {
return wipe()
}

// Since we might apply a side effect we clone it
currentOptions := m.currentOptions.Clone()
// If SketchLocation path is different but filename is the same, consider it equal
if filepath.Base(m.currentOptions.Get("sketchLocation")) == filepath.Base(prevOpts.Get("sketchLocation")) {
m.currentOptions.Remove("sketchLocation")
if filepath.Base(currentOptions.Get("sketchLocation")) == filepath.Base(prevOpts.Get("sketchLocation")) {
currentOptions.Remove("sketchLocation")
prevOpts.Remove("sketchLocation")
}

// If options are not changed check if core has
if m.currentOptions.Equals(prevOpts) {
if currentOptions.Equals(prevOpts) {
// check if any of the files contained in the core folders has changed
// since the json was generated - like platform.txt or similar
// if so, trigger a "safety" wipe
Expand Down
Loading
Loading