Closed insomniacslk closed 3 years ago
This is still a work in progress. I have to automatically generate cmds/contest/main.go via github actions, and validate the build.
For now this PR has:
contest-generator
cmds/contest/main.go
obtained by running ./contest-generator
cmds/contest/server/
which is now entirely embedded in the main.go
. This was probably used for testing, so I'm looking for usage and to replace it with the code generatorI see why the server
package. I'll try to fix the e2e tests
Merging #297 (dae4b27) into main (884d78e) will decrease coverage by
0.70%
. The diff coverage is31.85%
.:exclamation: Current head dae4b27 differs from pull request most recent head 5f67637. Consider uploading reports for the commit 5f67637 to get more accurate results
@@ Coverage Diff @@
## main #297 +/- ##
==========================================
- Coverage 69.37% 68.67% -0.71%
==========================================
Files 136 138 +2
Lines 7586 7718 +132
==========================================
+ Hits 5263 5300 +37
- Misses 1814 1897 +83
- Partials 509 521 +12
Flag | Coverage Δ | |
---|---|---|
e2e | 47.19% <30.43%> (-0.09%) |
:arrow_down: |
integration | 58.95% <ø> (-0.05%) |
:arrow_down: |
unittests | 50.27% <32.14%> (-0.72%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
Impacted Files | Coverage Δ | |
---|---|---|
cmds/contest-generator/main.go | 0.00% <0.00%> (ø) |
|
cmds/contest/server/server.go | 55.76% <27.27%> (-5.27%) |
:arrow_down: |
cmds/contest-generator/config.go | 46.75% <46.75%> (ø) |
|
plugins/listeners/httplistener/httplistener.go | 42.66% <100.00%> (ø) |
|
pkg/runner/test_runner.go | 91.91% <0.00%> (-0.60%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 884d78e...5f67637. Read the comment docs.
Note: the listener plugin is not customizable yet, because there is no listener interface. I will add it in a later PR
i'd suggest a YAML config file instead of a custom txt, for easier future extensibility.
i'd suggest a YMAL config file instead of a custom txt, for easier future extensibility.
The format could be something like:
targetmanagers:
- github.com/facebookincubator/contest/plugins/targetmanagers/targetlist
- ...
testfetchers:
- ...
Is this what you have in mind @rojer9-fb ?
I am not so happy of the mandatory indentation which I expect to lead to confusion, but this is simple enough to minimize the risk
Is this what you have in mind @rojer9-fb ?
yeah, pretty much
Done. The code is also a lot simpler now, thanks for the suggestion @rojer9-fb !
Addressed feedback from Deomid, and added validation / duplicate checks. Will address Tobias's feedback in the next iteration
I need to address more feedback, and add testing
LGTM, good to go once Tobias is also happy
split config functions and types into config.go
will add tests for configuration objects after lunch, everything else should be addressed. @tfg13 please take a look, I have left one of your comments unresolved with a question
Tests added. @tfg13 PTAL
fixed tests
would you say that adding a build.sh script to do all of what the readme expects the user do to (go build stuff) is helpful? I'm thinking since this PR has the semantics of providing a good to use binary with contest, maybe that goes the extra step for a turn-key solution.
would you say that adding a build.sh script to do all of what the readme expects the user do to (go build stuff) is helpful? I'm thinking since this PR has the semantics of providing a good to use binary with contest, maybe that goes the extra step for a turn-key solution.
Not entirely sure if I got your point, but if you are referring to simplifying the process of building ConTest with contest-generator, there is already a pre-generated main.go
under cmds/contest
. I think a build script would only add more layers and confusion, and if the user needs to customize the build, they still need to edit a text file and call contest-generator
, which is standard process for Go programs.
At the same time, this reminded me that contest-generator
needs to be called by GitHub Actions, and rebuild and validate cmds/contest/main.go
, which I'm going to do now
Yes, I'm talking about simplifying and guiding the user. The thing I have in mind is to have some extra checks for the user (I'm pretty sure a lot of people don't read the manual), like build.sh would point you to $EDITOR for the yaml file, then calls the contest-generator and go build and says "your binary is here".
Yes, I'm talking about simplifying and guiding the user. The thing I have in mind is to have some extra checks for the user (I'm pretty sure a lot of people don't read the manual), like build.sh would point you to $EDITOR for the yaml file, then calls the contest-generator and go build and says "your binary is here".
Honestly I think this is too far. For that kind of users we should just provide prebuilt binaries
since cmds/plugins
was removed because redundant, but still used by the migration tools, I moved that code directly into the migration tool
OK this is finally ready for the final review. A recap of the changes:
tests are green, and also improved error surfacing
contest-generator is a tool used to generate a
contest
executable with a custom set of plugins. See README.md for instructions.Signed-off-by: Andrea Barberio insomniac@slackware.it