keon94 commented on code in PR #2677:
URL: https://github.com/apache/incubator-devlake/pull/2677#discussion_r973538862


##########
test/lifecycle.go:
##########
@@ -0,0 +1,53 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package test
+
+import (
+       "github.com/apache/incubator-devlake/config"
+       "github.com/apache/incubator-devlake/helpers/e2ehelper"
+       "github.com/apache/incubator-devlake/plugins/core"
+       gitlabhack "github.com/apache/incubator-devlake/plugins/gitlab/api"
+       "github.com/apache/incubator-devlake/services"
+       "sync"
+)
+
+var once = &sync.Once{}
+
+// Setup sets up the environment for integration/e2e non-plugin tests. Wipes 
the DB and reruns all migrations.
+// NOTE: all plugins tests must run before any tests that use this function, 
otherwise there will be duplicate migration attempts!

Review Comment:
   consolidated the test/api/task and runner migrations logic in one place. 
It's important to delete any previously generated tables first, like I am doing 
here, because the plugins tests manually create their own tables and than can 
lead to duplicate table errors when running the logic here.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to