k1LoW / runn

runn is a package/tool for running operations following a scenario.
https://runn.run
MIT License
425 stars 31 forks source link

Add "Runner runner" that allows runners to be defined in the middle of steps. #966

Closed k1LoW closed 3 months ago

k1LoW commented 3 months ago

Usage

desc: Test with Runner runner
steps:
  -
    exec:
      command: somecommand
  -
    runner:
      db:
        dsn: ${{ previous.stdout }}
  -
    db:
      query: SELECT * FROM users;
    test: 'current.rows[0].username == "alice"'
github-actions[bot] commented 3 months ago

BenchmarkManyRunbooks-4

main (-) #966 (c3d8c1e) +/-
Number of iterations 1 1 0
Nanoseconds per iteration 3,899,992,938 ns/op 4,302,261,536 ns/op 402,268,598 ns/op
Bytes allocated per iteration 1,792,520,504 B/op 1,793,085,560 B/op 565,056 B/op
Allocs per iteration 21,413,148 allocs/op 21,414,082 allocs/op 934 allocs/op
Metadata | | [main](https://github.com/k1LoW/runn/tree/main) (-) | [#966](https://github.com/k1LoW/runn/pull/966) ([c3d8c1e](https://github.com/k1LoW/runn/commit/c3d8c1edd9582ad369ea63b4b5373d321000520d)) | |------------|----------------------------------------------------:|------------------------------------------------------------------------------------------------------------------------------------------:| | **goos** | linux | linux | | **goarch** | amd64 | amd64 | | **pkg** | github.com/k1LoW/runn | github.com/k1LoW/runn | | **cpu** | AMD EPYC 7763 64-Core Processor | AMD EPYC 7763 64-Core Processor |

BenchmarkOpenAPI3-4

main (-) #966 (c3d8c1e) +/-
Number of iterations 1 1 0
Nanoseconds per iteration 5,099,240,635 ns/op 5,188,451,557 ns/op 89,210,922 ns/op
Bytes allocated per iteration 2,956,051,688 B/op 2,956,705,368 B/op 653,680 B/op
Allocs per iteration 29,426,331 allocs/op 29,454,956 allocs/op 28,625 allocs/op
Metadata | | [main](https://github.com/k1LoW/runn/tree/main) (-) | [#966](https://github.com/k1LoW/runn/pull/966) ([c3d8c1e](https://github.com/k1LoW/runn/commit/c3d8c1edd9582ad369ea63b4b5373d321000520d)) | |------------|----------------------------------------------------:|------------------------------------------------------------------------------------------------------------------------------------------:| | **goos** | linux | linux | | **goarch** | amd64 | amd64 | | **pkg** | github.com/k1LoW/runn | github.com/k1LoW/runn | | **cpu** | AMD EPYC 7763 64-Core Processor | AMD EPYC 7763 64-Core Processor |

BenchmarkSingleRunbook-4

main (-) #966 (c3d8c1e) +/-
Number of iterations 18 19 1
Nanoseconds per iteration 63,514,207 ns/op 64,246,422 ns/op 732,215 ns/op
Bytes allocated per iteration 60,288,897 B/op 60,287,041 B/op -1,856 B/op
Allocs per iteration 205,782 allocs/op 205,784 allocs/op 2 allocs/op
Metadata | | [main](https://github.com/k1LoW/runn/tree/main) (-) | [#966](https://github.com/k1LoW/runn/pull/966) ([c3d8c1e](https://github.com/k1LoW/runn/commit/c3d8c1edd9582ad369ea63b4b5373d321000520d)) | |------------|----------------------------------------------------:|------------------------------------------------------------------------------------------------------------------------------------------:| | **goos** | linux | linux | | **goarch** | amd64 | amd64 | | **pkg** | github.com/k1LoW/runn | github.com/k1LoW/runn | | **cpu** | AMD EPYC 7763 64-Core Processor | AMD EPYC 7763 64-Core Processor |

Reported by octocov

github-actions[bot] commented 3 months ago

Code Metrics Report

main (1747dd2) #966 (c3d8c1e) +/-
Coverage 64.1% 64.1% +0.0%
Code to Test Ratio 1:0.4 1:0.4 +0.0
Test Execution Time 5m32s 6m1s +29s
Details ``` diff | | main (1747dd2) | #966 (c3d8c1e) | +/- | |---------------------|----------------|----------------|-------| + | Coverage | 64.1% | 64.1% | +0.0% | | Files | 76 | 77 | +1 | | Lines | 8459 | 8541 | +82 | + | Covered | 5427 | 5480 | +53 | + | Code to Test Ratio | 1:0.4 | 1:0.4 | +0.0 | | Code | 24050 | 24194 | +144 | + | Test | 11470 | 11586 | +116 | - | Test Execution Time | 5m32s | 6m1s | +29s | ```

Code coverage of files in pull request scope (80.1% → 79.3%)

Files Coverage +/-
book.go 78.7% +0.1%
operator.go 79.7% -0.6%
runner_runner.go 62.7% +62.7%
step.go 91.3% +0.1%

Reported by octocov

github-actions[bot] commented 3 months ago

BenchmarkManyRunbooks-4

main (-) #966 (d92a98b) +/-
Number of iterations 1 1 0
Nanoseconds per iteration 3,780,623,750 ns/op 3,840,118,728 ns/op 59,494,978 ns/op
Bytes allocated per iteration 1,793,209,208 B/op 1,793,116,960 B/op -92,248 B/op
Allocs per iteration 21,414,332 allocs/op 21,414,216 allocs/op -116 allocs/op
Metadata | | [main](https://github.com/k1LoW/runn/tree/main) (-) | [#966](https://github.com/k1LoW/runn/pull/966) ([d92a98b](https://github.com/k1LoW/runn/commit/d92a98bd19a2110043c9a5432fccbc021e9d2cd0)) | |------------|----------------------------------------------------:|------------------------------------------------------------------------------------------------------------------------------------------:| | **goos** | linux | linux | | **goarch** | amd64 | amd64 | | **pkg** | github.com/k1LoW/runn | github.com/k1LoW/runn | | **cpu** | AMD EPYC 7763 64-Core Processor | AMD EPYC 7763 64-Core Processor |

BenchmarkOpenAPI3-4

main (-) #966 (d92a98b) +/-
Number of iterations 1 1 0
Nanoseconds per iteration 5,182,153,061 ns/op 5,283,444,350 ns/op 101,291,289 ns/op
Bytes allocated per iteration 2,955,800,432 B/op 2,956,211,352 B/op 410,920 B/op
Allocs per iteration 29,424,886 allocs/op 29,428,473 allocs/op 3,587 allocs/op
Metadata | | [main](https://github.com/k1LoW/runn/tree/main) (-) | [#966](https://github.com/k1LoW/runn/pull/966) ([d92a98b](https://github.com/k1LoW/runn/commit/d92a98bd19a2110043c9a5432fccbc021e9d2cd0)) | |------------|----------------------------------------------------:|------------------------------------------------------------------------------------------------------------------------------------------:| | **goos** | linux | linux | | **goarch** | amd64 | amd64 | | **pkg** | github.com/k1LoW/runn | github.com/k1LoW/runn | | **cpu** | AMD EPYC 7763 64-Core Processor | AMD EPYC 7763 64-Core Processor |

BenchmarkSingleRunbook-4

main (-) #966 (d92a98b) +/-
Number of iterations 18 18 0
Nanoseconds per iteration 65,701,629 ns/op 64,829,567 ns/op -872,062 ns/op
Bytes allocated per iteration 60,287,302 B/op 60,309,296 B/op 21,994 B/op
Allocs per iteration 205,775 allocs/op 205,798 allocs/op 23 allocs/op
Metadata | | [main](https://github.com/k1LoW/runn/tree/main) (-) | [#966](https://github.com/k1LoW/runn/pull/966) ([d92a98b](https://github.com/k1LoW/runn/commit/d92a98bd19a2110043c9a5432fccbc021e9d2cd0)) | |------------|----------------------------------------------------:|------------------------------------------------------------------------------------------------------------------------------------------:| | **goos** | linux | linux | | **goarch** | amd64 | amd64 | | **pkg** | github.com/k1LoW/runn | github.com/k1LoW/runn | | **cpu** | AMD EPYC 7763 64-Core Processor | AMD EPYC 7763 64-Core Processor |

Reported by octocov

github-actions[bot] commented 3 months ago

Code Metrics Report

main (1747dd2) #966 (d92a98b) +/-
Coverage 64.1% 64.1% +0.0%
Code to Test Ratio 1:0.4 1:0.4 +0.0
Test Execution Time 5m32s 5m51s +19s
Details ``` diff | | main (1747dd2) | #966 (d92a98b) | +/- | |---------------------|----------------|----------------|-------| + | Coverage | 64.1% | 64.1% | +0.0% | | Files | 76 | 77 | +1 | | Lines | 8459 | 8541 | +82 | + | Covered | 5427 | 5480 | +53 | + | Code to Test Ratio | 1:0.4 | 1:0.4 | +0.0 | | Code | 24050 | 24194 | +144 | + | Test | 11470 | 11586 | +116 | - | Test Execution Time | 5m32s | 5m51s | +19s | ```

Code coverage of files in pull request scope (80.1% → 79.3%)

Files Coverage +/-
book.go 78.7% +0.1%
operator.go 79.7% -0.6%
runner_runner.go 62.7% +62.7%
step.go 91.3% +0.1%

Reported by octocov