Skip to content

[skip changelog] Refactor and add TEST_LDFLAGS to test-unit-race and test-legacy tasks #1417

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

Merged
merged 3 commits into from
Aug 27, 2021

Conversation

rsora
Copy link
Contributor

@rsora rsora commented Aug 27, 2021

Please check if the PR fulfills these requirements

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)
  • What kind of change does this PR introduce?

The PR adds the TEST_LDFLAGS to test-unit-race and test-legacy tasks

  • What is the current behavior?

The task test-unit-race was failing in checking if the correct version parameter are passed correctly during build time here https://github.com/arduino/arduino-cli/blob/master/version/version_test.go#L29

=== RUN   TestBuildInjectedInfo
    version_test.go:38: 
                Error Trace:    version_test.go:38
                Error:          Not equal: 
                                expected: "0.0.0-test.preview"
                                actual  : "0.0.0-git"
                            
                                Diff:
                                --- Expected
                                +++ Actual
                                @@ -1 +1 @@
                                -0.0.0-test.preview
                                +0.0.0-git
                Test:           TestBuildInjectedInfo
--- FAIL: TestBuildInjectedInfo (0.00s)
FAIL
coverage: 1.0% of statements in ./...
FAIL    github.com/arduino/arduino-cli/version  0.226s
FAIL
  • What is the new behavior?

Passing now to the task commands the TEST_LDFLAGS, the test runs successfully

  • Other information:

Bonus: Bumped the go version in the go.mod to 1.16 here c3358a0


See how to contribute

@rsora rsora requested review from per1234 and cmaglie August 27, 2021 09:04
@rsora
Copy link
Contributor Author

rsora commented Aug 27, 2021

@per1234 do you think that this is worth to port somehow in our asset repo?

Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It must be proof that nobody ever ran the test-unit-race task. Should we use the -race flag when the CI runs the unit tests? I guess it will make them take a little longer, but it doesn't seem to be significant, especially since the unit tests will always finish way before the integration test workflow run.

@rsora
Copy link
Contributor Author

rsora commented Aug 27, 2021

Should we use the -race flag when the CI runs the unit tests?

Sounds reasonable to me, I'll open another PR after discussing it with @cmaglie and @silvanocerza 👍

@rsora rsora merged commit b8d30dc into master Aug 27, 2021
@rsora rsora deleted the rsora/test-ldflags branch August 27, 2021 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants