You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by wa...@apache.org on 2022/06/15 07:56:36 UTC
[incubator-devlake] 09/12: add E2E_DB_URL
This is an automated email from the ASF dual-hosted git repository.
warren pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
commit 7269ca2ce994458fb678c0663a289e25d0eaf784
Author: linyh <ya...@meri.co>
AuthorDate: Wed Jun 15 13:00:06 2022 +0800
add E2E_DB_URL
---
.env.example | 1 +
.github/workflows/test-e2e.yml | 1 +
helpers/e2ehelper/data_flow_tester.go | 5 +++++
3 files changed, 7 insertions(+)
diff --git a/.env.example b/.env.example
index a7a161d8..818331dd 100644
--- a/.env.example
+++ b/.env.example
@@ -7,6 +7,7 @@ PLUGIN_DIR=bin/plugins
# Lake Database Connection String
DB_URL=mysql://merico:merico@mysql:3306/lake?charset=utf8mb4&parseTime=True
+E2E_DB_URL=mysql://merico:merico@mysql:3306/lake?charset=utf8mb4&parseTime=True
# Silent Error Warn Info
DB_LOGGING_LEVEL=Error
diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml
index 1e42cff0..e6420c44 100644
--- a/.github/workflows/test-e2e.yml
+++ b/.github/workflows/test-e2e.yml
@@ -40,6 +40,7 @@ jobs:
- name: Test
env:
DB_URL: mysql://root:root@db:3306/lake?charset=utf8mb4&loc=Asia%2fShanghai&parseTime=True
+ E2E_DB_URL: mysql://root:root@db:3306/lake?charset=utf8mb4&loc=Asia%2fShanghai&parseTime=True
run: |
cp .env.example .env
make e2e-test
diff --git a/helpers/e2ehelper/data_flow_tester.go b/helpers/e2ehelper/data_flow_tester.go
index 7b585c96..a006d56f 100644
--- a/helpers/e2ehelper/data_flow_tester.go
+++ b/helpers/e2ehelper/data_flow_tester.go
@@ -77,6 +77,11 @@ func NewDataFlowTester(t *testing.T, pluginName string, pluginMeta core.PluginMe
panic(err)
}
cfg := config.GetConfig()
+ e2eDbUrl := cfg.GetString(`E2E_DB_URL`)
+ if e2eDbUrl == `` {
+ panic(fmt.Errorf(`e2e can only run with E2E_DB_URL, please set it in .env`))
+ }
+ cfg.Set(`DB_URL`, cfg.GetString(`E2E_DB_URL`))
db, err := runner.NewGormDb(cfg, logger.Global)
if err != nil {
panic(err)