Add config file support to integration tests#2167
Add config file support to integration tests#2167pracucci merged 4 commits intocortexproject:masterfrom
Conversation
pstibrany
left a comment
There was a problem hiding this comment.
LGTM.
I'm little worried how many combinations we will be testing in query_frontend_test.go. Perhaps it would be worth doing some refactoring there, but it can also lead to big test obfuscation.
Me too. What're your thoughts about the refactoring? What would refactor? |
I used Table testing pattern but with a generated table here: https://github.com/cortexproject/cortex/blob/master/pkg/distributor/distributor_test.go#L284 Not sure its super useful in this case, but it does allow you to ensure you hit all the combinations of different parameters. |
Signed-off-by: Marco Pracucci <marco@pracucci.com>
Signed-off-by: Marco Pracucci <marco@pracucci.com>
…ectories Signed-off-by: Marco Pracucci <marco@pracucci.com>
Signed-off-by: Marco Pracucci <marco@pracucci.com>
5259d1f to
a66b16a
Compare
Not sure it would help much (will end up writing the same logic but in a single test). I've an idea to introduce fixtures support to the e2e framework, in order to be able to write a single test and then run it against different set of fixtures (different configs). I will give it a try when I've some spare time. |
Oh, I've never replied to this. Something like what Tom linked to or what querier_test.go in Cortex does to test various combinations of encodings and chunk merging algorithms. |
Yes, but we need custom setup for each test (reason why there's the setup function) so I don't see a real benefit (to me it's looks like testing style: single function, like table testing, or multiple functions). However, if we introduce a generic fixture support (moving the custom setup logic to re-usable fixtures), we may actually simplify these kinds of tests and make fixtures reusable across tests, but to me it's a work decoupled from this PR. |
👍
👍 |
* Added query-frontend support to local tsdb-blocks-storage-s3 dev env Signed-off-by: Marco Pracucci <marco@pracucci.com> * Introduced CortexService to have cleaner integration tests Signed-off-by: Marco Pracucci <marco@pracucci.com> * Added to writeFileToSharedDir() the ability to create the path of directories Signed-off-by: Marco Pracucci <marco@pracucci.com> * Enhanced query-frontend tests to run with config file too Signed-off-by: Marco Pracucci <marco@pracucci.com>
What this PR does:
While reviewing the PR #1878 it popped up that the PR may change the
query-frontendconfig requirements (discussion still on-going). This made me realise that we don't have any integration test running with the config instead of CLI flags.This PR is a first step to ease writing tests where Cortex gets started with a config file (CLI flags are still used for some overrides).
In particular:
query-frontendsupport to localtsdb-blocks-storage-s3dev envCortexServiceto have cleaner integration testswriteFileToSharedDir()the ability to create the path of directoriesquery-frontendtests to run with config file tooWhich issue(s) this PR fixes:
N/A
Checklist
CHANGELOG.mdupdated - the order of entries should be[CHANGE],[FEATURE],[ENHANCEMENT],[BUGFIX]