Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Part of #405 and #820
I will add the cronjob in another PR.
Things done
This pull request primarily extends the functionality of the
batchService
struct inpkg/batch/api/api.go
by adding new cache jobs for feature flags, segment users, API keys, experiments, and autoOps rules. Additionally, the testing suite inpkg/batch/api/api_test.go
has been updated to include tests for these new jobs and to make use of parallel testing.Here are the most important changes:
New cache jobs in
batchService
:type batchService struct {
: AddedfeatureFlagCacher
,segmentUserCacher
,apiKeyCacher
,experimentCacher
, andautoOpsRulesCacher
as new job fields in thebatchService
struct.func NewBatchService(
: Updated the function parameters and the returnedbatchService
to include the new jobs. [1] [2]func (s *batchService) ExecuteBatchJob(
: Extended the switch-case statement to handle the execution of the new jobs.Updates to the testing suite:
pkg/batch/api/api_test.go
: Added new imports for the mock clients needed for the new tests. [1] [2]type setupMockFunc func(
: Extended thesetupMockFunc
type to include the new mock clients. [1] [2]func TestExperimentStatusUpdater(t *testing.T) {
and other test functions: Updated thesetupMock
function calls to include the new mock clients and added thet.Parallel()
directive to enable parallel testing. [1] [2] [3] [4] [5] [6] [7]func TestFeatureFlagCacher(t *testing.T) {
and other new test functions: Added new test functions for the new jobs inbatchService
.func newBatchService(t *testing.T,
: Updated the function to create a newbatchService
for testing to include the new mock clients.