Skip to content

Commit

Permalink
chore(test): disable variable compression in integration test (#518)
Browse files Browse the repository at this point in the history
* test(integ): disable variable compression in integration test

* feat(ice): add disable-variable-compression feature flag
  • Loading branch information
dakimura committed Oct 19, 2021
1 parent 0b956f4 commit b1b7186
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
12 changes: 12 additions & 0 deletions contrib/ice/cmd/reorg/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package reorg

import (
"fmt"

"github.com/alpacahq/marketstore/v4/utils"
"github.com/spf13/cobra"

"github.com/alpacahq/marketstore/v4/contrib/ice/reorg"
Expand All @@ -10,6 +12,7 @@ import (

var reimport bool
var storeWithoutSymbols bool
var disableVarComp bool

// ImportCmd provides a command line interface for importing corporate action entries from ICE's data files
// without --reimport option it only imports unprocessed data files (those without .processed suffix)
Expand Down Expand Up @@ -44,6 +47,7 @@ var ImportCmd = &cobra.Command{
return fmt.Errorf("failed to create new instance setup for Import: %w", err)
}

utils.InstanceConfig.DisableVariableCompression = disableVarComp
err = reorg.Import(reorgDir, reimport, storeWithoutSymbols)
if err != nil {
return fmt.Errorf("failed to import: %w", err)
Expand All @@ -55,4 +59,12 @@ var ImportCmd = &cobra.Command{
func init() {
ImportCmd.Flags().BoolVarP(&reimport, "reimport", "r", false, "reimport")
ImportCmd.Flags().BoolVarP(&storeWithoutSymbols, "fallback-to-cusip", "c", false, "fallback-to-cusip")
// Please set the same value as disable_variable_compression in the marketstore's mkts.yml
// where this plugin is running.
// Different disable_variable_compression values between this plugin and mkts.yml
// causes unexpected data inconsistency issue.
// We need some refactor to prevent it from occurring due to this manual setting.
ImportCmd.Flags().BoolVarP(&disableVarComp, "disable-variable-compression", "d", false,
"disable variable compression feature",
)
}
3 changes: 2 additions & 1 deletion tests/integ/bin/mkts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ log_level: info
queryable: true
stop_grace_period: 0
wal_rotate_interval: 5
start_time: 2016-09-15 13:45
start_time: 2016-09-15 13:45
disable_variable_compression: true
2 changes: 1 addition & 1 deletion tests/integ/contrib/ice/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ mkts_copy_data:
docker cp ${PLUGIN_ROOT}/data ${MKTS_CONTAINER_NAME}:/project/data/contrib/ice/

mkts_import_ca:
docker exec ${MKTS_CONTAINER_NAME} bash -c "/bin/ice reorg import /project/data/mktsdb /project/data/contrib/ice/data --fallback-to-cusip"
docker exec ${MKTS_CONTAINER_NAME} bash -c "/bin/ice reorg import /project/data/mktsdb /project/data/contrib/ice/data --fallback-to-cusip --disable-variable-compression"

mkts_import_price:
docker exec ${MKTS_CONTAINER_NAME} bash -x /project/data/contrib/ice/data/load_price.sh
Expand Down
2 changes: 1 addition & 1 deletion tests/integ/contrib/ice/data/load_price.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

marketstore connect -d /project/data/mktsdb <<EOF
marketstore connect -d /project/data/mktsdb --disable_variable_compression=True <<EOF
\create AAPL/1D/OHLCV:Symbol/Timeframe/AttributeGroup Open,High,Low,Close/float64:Volume/int64 fixed
\load AAPL/1D/OHLCV /project/data/contrib/ice/data/aapl_raw.csv /project/data/contrib/ice/data/aapl_raw.yaml
EOF

0 comments on commit b1b7186

Please sign in to comment.