A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/arduino/arduino-cli/commit/d2cd38732a60269737bd17505f614afd948e2897 below:

Fixed invalid gRPC TaskProgress message on compile (#2731) · arduino/arduino-cli@d2cd387 · GitHub

File tree Expand file treeCollapse file tree 5 files changed

+27

-15

lines changed

Filter options

Expand file treeCollapse file tree 5 files changed

+27

-15

lines changed Original file line number Diff line number Diff line change

@@ -1,8 +1,6 @@

1 1

module github.com/arduino/arduino-cli

2 2 3 -

go 1.22

4 - 5 -

toolchain go1.22.3

3 +

go 1.22.3

6 4 7 5

// We must use this fork until https://github.com/mailru/easyjson/pull/372 is merged

8 6

replace github.com/mailru/easyjson => github.com/cmaglie/easyjson v0.8.1

@@ -38,6 +36,7 @@ require (

38 36

github.com/xeipuuv/gojsonschema v1.2.0

39 37

go.bug.st/cleanup v1.0.0

40 38

go.bug.st/downloader/v2 v2.2.0

39 +

go.bug.st/f v0.4.0

41 40

go.bug.st/relaxed-semver v0.12.0

42 41

go.bug.st/testifyjson v1.2.0

43 42

golang.org/x/term v0.25.0

Original file line number Diff line number Diff line change

@@ -215,6 +215,8 @@ go.bug.st/cleanup v1.0.0 h1:XVj1HZxkBXeq3gMT7ijWUpHyIC1j8XAoNSyQ06CskgA=

215 215

go.bug.st/cleanup v1.0.0/go.mod h1:EqVmTg2IBk4znLbPD28xne3abjsJftMdqqJEjhn70bk=

216 216

go.bug.st/downloader/v2 v2.2.0 h1:Y0jSuDISNhrzePkrAWqz9xUC3xol9hqZo/+tz1D4EqY=

217 217

go.bug.st/downloader/v2 v2.2.0/go.mod h1:VZW2V1iGKV8rJL2ZEGIDzzBeKowYv34AedJz13RzVII=

218 +

go.bug.st/f v0.4.0 h1:Vstqb950nMA+PhAlRxUw8QL1ntHy/gXHNyyzjkQLJ10=

219 +

go.bug.st/f v0.4.0/go.mod h1:bMo23205ll7UW63KwO1ut5RdlJ9JK8RyEEr88CmOF5Y=

218 220

go.bug.st/relaxed-semver v0.12.0 h1:se8v3lTdAAFp68+/RS/0Y/nFdnpdzkP5ICY04SPau4E=

219 221

go.bug.st/relaxed-semver v0.12.0/go.mod h1:Cpcbiig6Omwlq6bS7i3MQWiqS7W7HDd8CAnZFC40Cl0=

220 222

go.bug.st/serial v1.6.1 h1:VSSWmUxlj1T/YlRo2J104Zv3wJFrjHIl/T3NeruWAHY=

Original file line number Diff line number Diff line change

@@ -352,7 +352,10 @@ func (b *Builder) logIfVerbose(warn bool, msg string) {

352 352 353 353

// Build fixdoc

354 354

func (b *Builder) Build() error {

355 -

b.Progress.AddSubSteps(6 /** preprocess **/ + 21 /** build **/)

355 +

b.Progress.AddSubSteps(6 + // preprocess

356 +

18 + // build

357 +

1, // size

358 +

)

356 359

defer b.Progress.RemoveSubSteps()

357 360 358 361

if err := b.preprocess(); err != nil {

@@ -362,15 +365,10 @@ func (b *Builder) Build() error {

362 365

buildErr := b.build()

363 366 364 367

b.libsDetector.PrintUsedAndNotUsedLibraries(buildErr != nil)

365 -

b.Progress.CompleteStep()

366 - 367 368

b.printUsedLibraries(b.libsDetector.ImportedLibraries())

368 -

b.Progress.CompleteStep()

369 - 370 369

if buildErr != nil {

371 370

return buildErr

372 371

}

373 -

b.Progress.CompleteStep()

374 372 375 373

if err := b.size(); err != nil {

376 374

return err

Original file line number Diff line number Diff line change

@@ -24,7 +24,6 @@ import (

24 24

"time"

25 25 26 26

"github.com/arduino/arduino-cli/commands/cmderrors"

27 -

f "github.com/arduino/arduino-cli/internal/algorithms"

28 27

"github.com/arduino/arduino-cli/internal/integrationtest"

29 28

"github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"

30 29

"github.com/arduino/go-paths-helper"

@@ -194,13 +193,15 @@ func TestDaemonCompileOptions(t *testing.T) {

194 193

if msg.GetErrStream() != nil {

195 194

fmt.Printf("COMPILE> %v\n", string(msg.GetErrStream()))

196 195

}

197 -

analyzer.Process(msg.GetProgress())

196 +

if pr := msg.GetProgress(); pr != nil {

197 +

fmt.Printf("COMPILE PROGRESS> %v\n", pr)

198 +

analyzer.Process(pr)

199 +

}

198 200

}

201 + 199 202

// https://github.com/arduino/arduino-cli/issues/2016

200 -

// assert that the task progress is increasing and doesn't contain multiple 100% values

201 -

results := analyzer.Results[""]

202 -

require.True(t, results[len(results)-1].GetCompleted(), fmt.Sprintf("latest percent value: %v", results[len(results)-1].GetPercent()))

203 -

require.IsNonDecreasing(t, f.Map(results, (*commands.TaskProgress).GetPercent))

203 +

// https://github.com/arduino/arduino-cli/issues/2711

204 +

analyzer.Check(t)

204 205

}

205 206 206 207

func TestDaemonCompileAfterFailedLibInstall(t *testing.T) {

Original file line number Diff line number Diff line change

@@ -19,6 +19,8 @@ import (

19 19

"testing"

20 20 21 21

"github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"

22 +

"github.com/stretchr/testify/require"

23 +

"go.bug.st/f"

22 24

)

23 25 24 26

// TaskProgressAnalyzer analyzes TaskProgress messages for consistency

@@ -44,3 +46,13 @@ func (a *TaskProgressAnalyzer) Process(progress *commands.TaskProgress) {

44 46

taskName := progress.GetName()

45 47

a.Results[taskName] = append(a.Results[taskName], progress)

46 48

}

49 + 50 +

func (a *TaskProgressAnalyzer) Check(t *testing.T) {

51 +

for task, results := range a.Results {

52 +

require.Equal(t, 1, f.Count(results, (*commands.TaskProgress).GetCompleted), "Got multiple 'completed' messages on task %s", task)

53 +

l := len(results)

54 +

require.True(t, results[l-1].GetCompleted(), "Last message is not 'completed' on task: %s", task)

55 +

require.Equal(t, results[l-1].GetPercent(), float32(100), "Last message is not 100% on task: %s", task)

56 +

require.IsNonDecreasing(t, f.Map(results, (*commands.TaskProgress).GetPercent), "Percentages are not increasing on task: %s", task)

57 +

}

58 +

}

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4