Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a test to verify that the server can be run for 1 minute with all…
… services enabled
- Loading branch information
1 parent
5721cf8
commit b2c09ef
Showing
4 changed files
with
83 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// The MIT License | ||
// | ||
// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. | ||
// | ||
// Copyright (c) 2020 Uber Technologies, Inc. | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
// THE SOFTWARE. | ||
|
||
// package smoke contains tests that verify very basic functionality of the server. | ||
// They're similar to integration tests, but we only run them for one DB type. | ||
// This needs to be in a separate package because the other tests in the parent directory modify the same global | ||
// variables as this test. | ||
package smoke | ||
|
||
import ( | ||
"path" | ||
"testing" | ||
"time" | ||
|
||
"github.com/stretchr/testify/assert" | ||
"github.com/stretchr/testify/require" | ||
|
||
"go.temporal.io/server/common/config" | ||
"go.temporal.io/server/temporal" | ||
"go.temporal.io/server/tests/testutils" | ||
|
||
// this is needed to register the sqlite plugin | ||
_ "go.temporal.io/server/common/persistence/sql/sqlplugin/sqlite" | ||
) | ||
|
||
// TestServerImpl_Start verifies that the server can be started and run for a minute without crashing | ||
func TestServerImpl_Start(t *testing.T) { | ||
configDir := path.Join(testutils.GetRepoRootDirectory(), "config") | ||
cfg, err := config.LoadConfig("development-sqlite", configDir, "") | ||
require.NoError(t, err) | ||
cfg.DynamicConfigClient.Filepath = path.Join(configDir, "dynamicconfig", "development-sql.yaml") | ||
server, err := temporal.NewServer( | ||
temporal.ForServices(temporal.DefaultServices), | ||
temporal.WithConfig(cfg), | ||
) | ||
assert.NoError(t, err) | ||
err = server.Start() | ||
if assert.NoError(t, err) { | ||
time.Sleep(time.Minute) | ||
} | ||
defer func() { | ||
err = server.Stop() | ||
assert.NoError(t, err) | ||
}() | ||
} |