feat(test): enable running very_good test --optimization for specific files/directory#564
feat(test): enable running very_good test --optimization for specific files/directory#564agacemi wants to merge 2 commits intoVeryGoodOpenSource:mainfrom
Conversation
641b42c to
53835f2
Compare
… files/directories
53835f2 to
6aa418e
Compare
renancaraujo
left a comment
There was a problem hiding this comment.
I left here some remarks about the overall implementation.
Thanks for the time you took for this. It may be better to have an issue before a PR so we can discuss and understand better on top of the problem.
Also, your implementation seems to be breaking the e2e test (which proves that this is a breaking change), may be fas to fix (just remove the path argument).
If you want to follow up on this, wait for a couple of days when the test_runner brick will be unbundled in this repo (so things may be easier to review and update).
| "path": "pre_gen.dart", | ||
| "data": | ||
| "aW1wb3J0ICdkYXJ0OmlvJzsKCmltcG9ydCAncGFja2FnZTptYXNvbi9tYXNvbi5kYXJ0JzsKaW1wb3J0ICdwYWNrYWdlOnBhdGgvcGF0aC5kYXJ0JyBhcyBwYXRoOwoKRnV0dXJlPHZvaWQ+IHJ1bihIb29rQ29udGV4dCBjb250ZXh0KSBhc3luYyB7CiAgZmluYWwgcGFja2FnZVJvb3QgPSBjb250ZXh0LnZhcnNbJ3BhY2thZ2Utcm9vdCddOwogIGZpbmFsIHRlc3REaXIgPSBEaXJlY3RvcnkocGF0aC5qb2luKHBhY2thZ2VSb290LCAndGVzdCcpKTsKCiAgaWYgKCF0ZXN0RGlyLmV4aXN0c1N5bmMoKSkgewogICAgY29udGV4dC5sb2dnZXIuZXJyKCdDb3VsZCBub3QgZmluZCBkaXJlY3RvcnkgJHt0ZXN0RGlyLnBhdGh9Jyk7CiAgICBleGl0KDEpOwogIH0KCiAgZmluYWwgcHVic3BlYyA9IEZpbGUocGF0aC5qb2luKHBhY2thZ2VSb290LCAncHVic3BlYy55YW1sJykpOwogIGlmICghcHVic3BlYy5leGlzdHNTeW5jKCkpIHsKICAgIGNvbnRleHQubG9nZ2VyLmVycignQ291bGQgbm90IGZpbmQgcHVic3BlYy55YW1sIGF0ICR7dGVzdERpci5wYXRofScpOwogICAgZXhpdCgxK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BhdGgpLnN0YXJ0c1dpdGgodGVzdFBhdGgpKSkKICAgICAgLm1hcCgoZW50aXR5KSA9PgogICAgICAgIHBhdGgucmVsYXRpdmUoZW50aXR5LnBhdGgsIGZyb206IHRlc3REaXIucGF0aCkucmVwbGFjZUFsbChyJ1wnLCAnLycpKQogICAgICAudG9MaXN0KCk7CgogIGNvbnRleHQudmFycyA9IHsndGVzdHMnOiB0ZXN0cywgJ2lzRmx1dHRlcic6IGlzRmx1dHRlcn07Cn0KCmV4dGVuc2lvbiBvbiBGaWxlU3lzdGVtRW50aXR5IHsKICBib29sIGdldCBpc1Rlc3QgewogICAgcmV0dXJuIHRoaXMgaXMgRmlsZSAmJiBwYXRoLmJhc2VuYW1lKHRoaXMucGF0aCkuZW5kc1dpdGgoJ190ZXN0LmRhcnQnKTsKICB9Cn0=", |
There was a problem hiding this comment.
Seems like ithis pr adds a parameter to the rest runner that is not listed on the brick.yaml file
| '--no-pub', | ||
| ..._argResults.rest, | ||
| if (!isOptimizationApplied) ..._argResults.rest, |
There was a problem hiding this comment.
This is a breaking change. People that passed trailing arguments (previously ignored) now may face some errors.
Which is the case for our e2e tests
| final directory = Directory.systemTemp.createTempSync(); | ||
| final originalVars = <String, dynamic>{'package-root': directory.path}; | ||
| final originalVars = <String, dynamic>{ | ||
| 'package-root': directory.path, | ||
| 'test-paths': <String>[], | ||
| }; | ||
| final updatedVars = <String, dynamic>{ | ||
| 'package-root': directory.path, | ||
| 'foo': 'bar' | ||
| 'foo': 'bar', | ||
| 'test-paths': <String>[] | ||
| }; |
There was a problem hiding this comment.
Need a new test with some paths
Thank you for reviewing. At first, I wanted to solve the issue #508. On other hand, our team expressed this need : We have more than 4000 tests. Our base code is organized around many folders, each folder deals with a feature managed by a team. Thus, we wanted to speed up tests by enabling optimization if very_good was run on a given folder. Hence, my PR. Regarding the breaking change, I have not idea what could be trailing arguments except directories or files path ?! This PR assume that the rest of result, if given, are necessarily specific files or specific directories. Maybe I was wrong Please, let me know when test_runner brick is unbundled to resume some fix you requested. |
#639 is merged so that the changes can be done to the |
|
@agacemi do you plan to followup on this? |
|
@renancaraujo Yes absolutely. I'am just waiting for the acceptation of merge on my other PR #563 to avoid rebase hell :) and approval dismissing. |
|
@agacemi looking for an update on this PR from your side. It's been sitting for some time so it has some merge conflicts that need to be solved. |
Thanks for the update @agacemi. Given that I'm going to close this for now so it doesn't continue to popup in our dashboards. When you do have time to work on this feel free to either reopen this with the needed changes or start a new PR. |
Description
In the current version, optimization is disabled if we give additional directoires or files to
very_good testcommand line. The goal of this PR is to add the ability to run `'very_good test' with optimization on a specific files or directoriesc or both.Type of Change