diff --git a/ghost/tinybird/scripts/branch_and_test.sh b/ghost/tinybird/scripts/branch_and_test.sh index ee6cae88f6..ac8de7af91 100755 --- a/ghost/tinybird/scripts/branch_and_test.sh +++ b/ghost/tinybird/scripts/branch_and_test.sh @@ -17,6 +17,9 @@ for arg in "$@"; do fi done +# Allow version to be passed in or default to 0 +export TB_VERSION=${TB_VERSION:-0} + # Attempt to create the branch and check for errors if ! tb branch create "$BRANCH_NAME"; then echo "🚨 ERROR: Failed to create branch $BRANCH_NAME. Exiting." diff --git a/ghost/tinybird/scripts/exec_test.sh b/ghost/tinybird/scripts/exec_test.sh index 02d52c08d1..2884216aa5 100755 --- a/ghost/tinybird/scripts/exec_test.sh +++ b/ghost/tinybird/scripts/exec_test.sh @@ -3,6 +3,9 @@ set -euo pipefail export TB_VERSION_WARNING=0 +# Default version if not provided +export TB_VERSION=${TB_VERSION:-0} + # Get the expected count once, outside of any function ndjson_file="./datasources/fixtures/analytics_events.ndjson" export expected_count=$(wc -l < "$ndjson_file" || echo "0") diff --git a/ghost/tinybird/tests/all_kpis.test b/ghost/tinybird/tests/all_kpis.test index ed8400dca9..5203e5adb5 100644 --- a/ghost/tinybird/tests/all_kpis.test +++ b/ghost/tinybird/tests/all_kpis.test @@ -1 +1 @@ -tb pipe data kpis --date_from 2100-01-01 --date_to 2100-01-07 --site_uuid mock_site_uuid --format CSV +tb pipe data kpis__v${TB_VERSION:-0} --date_from 2100-01-01 --date_to 2100-01-07 --site_uuid mock_site_uuid --format CSV diff --git a/ghost/tinybird/tests/all_top_browsers.test b/ghost/tinybird/tests/all_top_browsers.test index 2790787c86..1e9a0bc916 100644 --- a/ghost/tinybird/tests/all_top_browsers.test +++ b/ghost/tinybird/tests/all_top_browsers.test @@ -1 +1 @@ - tb pipe data top_browsers --date_from 2100-01-01 --date_to 2100-01-07 --site_uuid mock_site_uuid --format CSV +tb pipe data top_browsers__v${TB_VERSION:-0} --date_from 2100-01-01 --date_to 2100-01-07 --site_uuid mock_site_uuid --format CSV diff --git a/ghost/tinybird/tests/all_top_devices.test b/ghost/tinybird/tests/all_top_devices.test index 0741ac0659..63b74dc435 100644 --- a/ghost/tinybird/tests/all_top_devices.test +++ b/ghost/tinybird/tests/all_top_devices.test @@ -1,2 +1 @@ - - tb pipe data top_devices --date_from 2100-01-01 --date_to 2100-01-07 --site_uuid mock_site_uuid --format CSV +tb pipe data top_devices__v${TB_VERSION:-0} --date_from 2100-01-01 --date_to 2100-01-07 --site_uuid mock_site_uuid --format CSV diff --git a/ghost/tinybird/tests/all_top_locations.test b/ghost/tinybird/tests/all_top_locations.test index ba0667d303..d20463d346 100644 --- a/ghost/tinybird/tests/all_top_locations.test +++ b/ghost/tinybird/tests/all_top_locations.test @@ -1,2 +1 @@ - - tb pipe data top_locations --date_from 2100-01-01 --date_to 2100-01-07 --site_uuid mock_site_uuid --format CSV +tb pipe data top_locations__v${TB_VERSION:-0} --date_from 2100-01-01 --date_to 2100-01-07 --site_uuid mock_site_uuid --format CSV diff --git a/ghost/tinybird/tests/all_top_pages.test b/ghost/tinybird/tests/all_top_pages.test index 2fbd8b270e..24ff1d89b2 100644 --- a/ghost/tinybird/tests/all_top_pages.test +++ b/ghost/tinybird/tests/all_top_pages.test @@ -1 +1 @@ -tb pipe data top_pages --date_from 2100-01-01 --date_to 2100-01-07 --site_uuid mock_site_uuid --format CSV +tb pipe data top_pages__v${TB_VERSION:-0} --date_from 2100-01-01 --date_to 2100-01-07 --site_uuid mock_site_uuid --format CSV diff --git a/ghost/tinybird/tests/all_top_sources.test b/ghost/tinybird/tests/all_top_sources.test index bc2f422fa6..1cef353523 100644 --- a/ghost/tinybird/tests/all_top_sources.test +++ b/ghost/tinybird/tests/all_top_sources.test @@ -1 +1 @@ -tb pipe data top_sources --date_from 2100-01-01 --date_to 2100-01-07 --site_uuid mock_site_uuid --format CSV +tb pipe data top_sources__v${TB_VERSION:-0} --date_from 2100-01-01 --date_to 2100-01-07 --site_uuid mock_site_uuid --format CSV diff --git a/ghost/tinybird/tests/filter_browser_chrome_kpis.test b/ghost/tinybird/tests/filter_browser_chrome_kpis.test index 24a90ac25b..4fa5c1f8cd 100644 --- a/ghost/tinybird/tests/filter_browser_chrome_kpis.test +++ b/ghost/tinybird/tests/filter_browser_chrome_kpis.test @@ -1 +1 @@ -tb pipe data kpis --date_from 2100-01-01 --date_to 2100-01-07 --site_uuid mock_site_uuid --format CSV --browser chrome +tb pipe data kpis__v${TB_VERSION:-0} --date_from 2100-01-01 --date_to 2100-01-07 --site_uuid mock_site_uuid --format CSV --browser chrome diff --git a/ghost/tinybird/tests/filter_browser_chrome_top_browsers.test b/ghost/tinybird/tests/filter_browser_chrome_top_browsers.test index 7ee4499fe7..f9880f9727 100644 --- a/ghost/tinybird/tests/filter_browser_chrome_top_browsers.test +++ b/ghost/tinybird/tests/filter_browser_chrome_top_browsers.test @@ -1 +1 @@ -tb pipe data top_browsers --date_from 2100-01-01 --date_to 2100-01-07 --site_uuid mock_site_uuid --format CSV --browser chrome +tb pipe data top_browsers__v${TB_VERSION:-0} --date_from 2100-01-01 --date_to 2100-01-07 --site_uuid mock_site_uuid --format CSV --browser chrome diff --git a/ghost/tinybird/tests/filter_browser_chrome_top_pages.test b/ghost/tinybird/tests/filter_browser_chrome_top_pages.test index ea53c29c55..e8937e4ac4 100644 --- a/ghost/tinybird/tests/filter_browser_chrome_top_pages.test +++ b/ghost/tinybird/tests/filter_browser_chrome_top_pages.test @@ -1 +1 @@ -tb pipe data top_pages --date_from 2100-01-01 --date_to 2100-01-07 --site_uuid mock_site_uuid --format CSV --browser chrome +tb pipe data top_pages__v${TB_VERSION:-0} --date_from 2100-01-01 --date_to 2100-01-07 --site_uuid mock_site_uuid --format CSV --browser chrome diff --git a/ghost/tinybird/tests/filter_browser_chrome_top_sources.test b/ghost/tinybird/tests/filter_browser_chrome_top_sources.test index 791f4c108a..20b6acf805 100644 --- a/ghost/tinybird/tests/filter_browser_chrome_top_sources.test +++ b/ghost/tinybird/tests/filter_browser_chrome_top_sources.test @@ -1 +1 @@ -tb pipe data top_sources --date_from 2100-01-01 --date_to 2100-01-07 --site_uuid mock_site_uuid --format CSV --browser chrome +tb pipe data top_sources__v${TB_VERSION:-0} --date_from 2100-01-01 --date_to 2100-01-07 --site_uuid mock_site_uuid --format CSV --browser chrome diff --git a/ghost/tinybird/tests/filter_source_bing_kpis.test b/ghost/tinybird/tests/filter_source_bing_kpis.test index 823fcdc1ca..569f31779c 100644 --- a/ghost/tinybird/tests/filter_source_bing_kpis.test +++ b/ghost/tinybird/tests/filter_source_bing_kpis.test @@ -1 +1 @@ -tb pipe data kpis --date_from 2100-01-01 --date_to 2100-01-07 --site_uuid mock_site_uuid --format CSV --source bing.com +tb pipe data kpis__v${TB_VERSION:-0} --date_from 2100-01-01 --date_to 2100-01-07 --site_uuid mock_site_uuid --format CSV --source bing.com diff --git a/ghost/tinybird/tests/filter_source_bing_top_browsers.test b/ghost/tinybird/tests/filter_source_bing_top_browsers.test index 4761e986dd..c8911fcb99 100644 --- a/ghost/tinybird/tests/filter_source_bing_top_browsers.test +++ b/ghost/tinybird/tests/filter_source_bing_top_browsers.test @@ -1 +1 @@ -tb pipe data top_browsers --date_from 2100-01-01 --date_to 2100-01-07 --site_uuid mock_site_uuid --format CSV --source bing.com +tb pipe data top_browsers__v${TB_VERSION:-0} --date_from 2100-01-01 --date_to 2100-01-07 --site_uuid mock_site_uuid --format CSV --source bing.com diff --git a/ghost/tinybird/tests/filter_source_bing_top_pages.test b/ghost/tinybird/tests/filter_source_bing_top_pages.test index 434a2b2f5e..33a77dd39b 100644 --- a/ghost/tinybird/tests/filter_source_bing_top_pages.test +++ b/ghost/tinybird/tests/filter_source_bing_top_pages.test @@ -1 +1 @@ -tb pipe data top_pages --date_from 2100-01-01 --date_to 2100-01-07 --site_uuid mock_site_uuid --format CSV --source bing.com +tb pipe data top_pages__v${TB_VERSION:-0} --date_from 2100-01-01 --date_to 2100-01-07 --site_uuid mock_site_uuid --format CSV --source bing.com diff --git a/ghost/tinybird/tests/filter_source_bing_top_sources.test b/ghost/tinybird/tests/filter_source_bing_top_sources.test index 9bd58bade5..3d13d32b79 100644 --- a/ghost/tinybird/tests/filter_source_bing_top_sources.test +++ b/ghost/tinybird/tests/filter_source_bing_top_sources.test @@ -1 +1 @@ -tb pipe data top_sources --date_from 2100-01-01 --date_to 2100-01-07 --site_uuid mock_site_uuid --format CSV --source bing.com +tb pipe data top_sources__v${TB_VERSION:-0} --date_from 2100-01-01 --date_to 2100-01-07 --site_uuid mock_site_uuid --format CSV --source bing.com