clean up messy initial comit, remove last traces of working project name, and add resilience to db test.
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
/.idea
|
||||
/graph/graphcore/*
|
||||
Generated
-8
@@ -1,8 +0,0 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
Generated
-5
@@ -1,5 +0,0 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<state>
|
||||
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
|
||||
</state>
|
||||
</component>
|
||||
Generated
-11
@@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
|
||||
<data-source source="LOCAL" name="xiaoli@localhost" uuid="58ed4679-da13-4e36-bc48-70b2cb7bb1fe">
|
||||
<driver-ref>mariadb</driver-ref>
|
||||
<synchronize>true</synchronize>
|
||||
<jdbc-driver>org.mariadb.jdbc.Driver</jdbc-driver>
|
||||
<jdbc-url>jdbc:mariadb://localhost:3306/xiaoli</jdbc-url>
|
||||
</data-source>
|
||||
</component>
|
||||
</project>
|
||||
Generated
-13
@@ -1,13 +0,0 @@
|
||||
<component name="ProjectDictionaryState">
|
||||
<dictionary name="gisle">
|
||||
<words>
|
||||
<w>blargh</w>
|
||||
<w>blendings</w>
|
||||
<w>graphcore</w>
|
||||
<w>qpos</w>
|
||||
<w>sourcream</w>
|
||||
<w>stufflog</w>
|
||||
<w>xiaoli</w>
|
||||
</words>
|
||||
</dictionary>
|
||||
</component>
|
||||
Generated
-6
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="JavaScriptSettings">
|
||||
<option name="languageLevel" value="ES6" />
|
||||
</component>
|
||||
</project>
|
||||
Generated
-8
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/xiaoli.iml" filepath="$PROJECT_DIR$/.idea/xiaoli.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
Generated
-7
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="SqlDialectMappings">
|
||||
<file url="file://$PROJECT_DIR$/migrations/mysql/20200405173553_create_table_project.sql" dialect="GenericSQL" />
|
||||
<file url="PROJECT" dialect="MariaDB" />
|
||||
</component>
|
||||
</project>
|
||||
Generated
-29
@@ -1,29 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectTasksOptions">
|
||||
<TaskOptions isEnabled="true">
|
||||
<option name="arguments" value="fmt $FilePath$" />
|
||||
<option name="checkSyntaxErrors" value="true" />
|
||||
<option name="description" />
|
||||
<option name="exitCodeBehavior" value="ERROR" />
|
||||
<option name="fileExtension" value="go" />
|
||||
<option name="immediateSync" value="false" />
|
||||
<option name="name" value="go fmt" />
|
||||
<option name="output" value="$FilePath$" />
|
||||
<option name="outputFilters">
|
||||
<array />
|
||||
</option>
|
||||
<option name="outputFromStdout" value="false" />
|
||||
<option name="program" value="$GoExecPath$" />
|
||||
<option name="runOnExternalChanges" value="false" />
|
||||
<option name="scopeName" value="Project Files" />
|
||||
<option name="trackOnlyRoot" value="true" />
|
||||
<option name="workingDir" value="$ProjectFileDir$" />
|
||||
<envs>
|
||||
<env name="GOROOT" value="$GOROOT$" />
|
||||
<env name="GOPATH" value="$GOPATH$" />
|
||||
<env name="PATH" value="$GoBinDirs$" />
|
||||
</envs>
|
||||
</TaskOptions>
|
||||
</component>
|
||||
</project>
|
||||
Generated
-8
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -13,17 +13,26 @@ var testDB *DB
|
||||
func TestMain(m *testing.M) {
|
||||
testDbConnect := os.Getenv("DB_TEST_CONNECT")
|
||||
if testDbConnect == "" {
|
||||
testDbConnect = "xiaoli_test:test1234@(localhost:3306)/xiaoli_test"
|
||||
testDbConnect = "stufflog_test:test1234@(localhost:3306)/stufflog_test"
|
||||
}
|
||||
|
||||
db, err := Open(testDbConnect)
|
||||
if err != nil {
|
||||
log.Println("DB ERROR", err)
|
||||
for i := 0; i < 10; i++ {
|
||||
db, err := Open(testDbConnect)
|
||||
if err != nil {
|
||||
log.Println("DB ERROR", err)
|
||||
time.Sleep(time.Second)
|
||||
continue
|
||||
}
|
||||
|
||||
testDB = db
|
||||
}
|
||||
if testDB == nil {
|
||||
log.Println("DB FAILED")
|
||||
os.Exit(1)
|
||||
return
|
||||
}
|
||||
|
||||
err = goose.SetDialect("mysql")
|
||||
err := goose.SetDialect("mysql")
|
||||
if err != nil {
|
||||
log.Println("GOOSE ERROR", err)
|
||||
os.Exit(1)
|
||||
@@ -31,20 +40,19 @@ func TestMain(m *testing.M) {
|
||||
}
|
||||
|
||||
for {
|
||||
err = goose.Down(db.db.DB, "../../../migrations/mysql")
|
||||
err = goose.Down(testDB.db.DB, "../../../migrations/mysql")
|
||||
if err != nil {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
err = goose.Up(db.db.DB, "../../../migrations/mysql")
|
||||
err = goose.Up(testDB.db.DB, "../../../migrations/mysql")
|
||||
if err != nil && err != goose.ErrNoNextVersion && err != goose.ErrNoCurrentVersion {
|
||||
log.Println("UP ERROR", err)
|
||||
os.Exit(3)
|
||||
return
|
||||
}
|
||||
|
||||
testDB = db
|
||||
code := m.Run()
|
||||
|
||||
os.Exit(code)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,38 +0,0 @@
|
||||
// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
|
||||
|
||||
package graphcore
|
||||
|
||||
import (
|
||||
"git.aiterp.net/stufflog/server/models"
|
||||
)
|
||||
|
||||
// A limited filter for constraining the list of issues within a project.
|
||||
type ProjectIssueFilter struct {
|
||||
// Filter by assignee IDs
|
||||
AssigneeIds []string `json:"assigneeIds"`
|
||||
// Text search
|
||||
Search *string `json:"search"`
|
||||
// Earliest stage (inclusive)
|
||||
MinStage *int `json:"minStage"`
|
||||
// Latest stage (inclusive)
|
||||
MaxStage *int `json:"maxStage"`
|
||||
// Limit the result set
|
||||
Limit *int `json:"limit"`
|
||||
}
|
||||
|
||||
// The permissions of a user within the project.
|
||||
type ProjectPermissions struct {
|
||||
// User ID.
|
||||
UserID string `json:"userId"`
|
||||
// Access level.
|
||||
AccessLevel int `json:"accessLevel"`
|
||||
// The user whose permissions it is. Can be null if the user no longer exists.
|
||||
User *models.User `json:"user"`
|
||||
}
|
||||
|
||||
// Input for loginUser.
|
||||
type UserLoginInput struct {
|
||||
UserID string `json:"userId"`
|
||||
Password string `json:"password"`
|
||||
RememberMe bool `json:"rememberMe"`
|
||||
}
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
|
||||
func main() {
|
||||
app := &cli.App{
|
||||
Name: "xiaoli",
|
||||
Name: "stufflog",
|
||||
Usage: "Issue tracker for your home and hobbies",
|
||||
Flags: []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
@@ -23,7 +23,7 @@ func main() {
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "db-connect",
|
||||
Value: "xiaoli_user:stuff1234@(localhost:3306)/xiaoli",
|
||||
Value: "stufflog_user:stuff1234@(localhost:3306)/stufflog",
|
||||
Usage: "Database connection string or path",
|
||||
EnvVars: []string{"DATABASE_CONNECT"},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user