-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
e2e-tests: Filter processor e2e test (#1493)
- Loading branch information
1 parent
146c4d3
commit 922653f
Showing
6 changed files
with
119 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from e2e_conduit.fixtures.processors.filter import FilterProcessor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from e2e_conduit.fixtures.plugin_fixture import PluginFixture | ||
|
||
|
||
''' FilterProcessor is a simple passthrough for the `filter_processor` | ||
which sets the scenario's filters to the initialized value | ||
''' | ||
class FilterProcessor(PluginFixture): | ||
def __init__(self, filters, search_inner=True): | ||
self.filters = filters | ||
self.search_inner = search_inner | ||
super().__init__() | ||
|
||
@property | ||
def name(self): | ||
return "filter_processor" | ||
|
||
def resolve_config_input(self): | ||
self.config_input["filters"] = self.filters | ||
self.config_input["search-inner"] = self.search_inner | ||
|
||
def resolve_config_output(self): | ||
pass | ||
|
||
def setup(self, accumulated_config): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import e2e_conduit.fixtures.importers as importers | ||
import e2e_conduit.fixtures.processors as processors | ||
import e2e_conduit.fixtures.exporters as exporters | ||
from e2e_conduit.scenarios import Scenario, scenarios | ||
|
||
|
||
def app_filter_indexer_scenario(sourcenet): | ||
return Scenario( | ||
"app_filter_indexer_scenario", | ||
importer=importers.FollowerAlgodImporter(sourcenet), | ||
processors=[ | ||
processors.FilterProcessor([ | ||
{"any": [ | ||
{"tag": "txn.type", | ||
"expression-type": "equal", | ||
"expression": "appl" | ||
} | ||
]} | ||
]), | ||
], | ||
exporter=exporters.PostgresqlExporter(), | ||
) | ||
|
||
|
||
def pay_filter_indexer_scenario(sourcenet): | ||
return Scenario( | ||
"pay_filter_indexer_scenario", | ||
importer=importers.FollowerAlgodImporter(sourcenet), | ||
processors=[ | ||
processors.FilterProcessor([ | ||
{"any": [ | ||
{"tag": "txn.type", | ||
"expression-type": "equal", | ||
"expression": "pay" | ||
} | ||
]} | ||
]), | ||
], | ||
exporter=exporters.PostgresqlExporter(), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
#!/usr/bin/env python3 | ||
# | ||
|
||
import atexit | ||
import glob | ||
import gzip | ||
|