Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
e43e58c7
Unverified
Commit
e43e58c7
authored
Jun 14, 2016
by
Jordan Liggitt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow specifying base location for test etcd data
parent
acda24ae
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
testing.md
docs/devel/testing.md
+9
-0
utils.go
pkg/storage/etcd/testing/utils.go
+8
-2
No files found.
docs/devel/testing.md
View file @
e43e58c7
...
...
@@ -50,6 +50,7 @@ Updated: 5/21/2016
-
[
Benchmark unit tests
](
#benchmark-unit-tests
)
-
[
Integration tests
](
#integration-tests
)
-
[
Install etcd dependency
](
#install-etcd-dependency
)
-
[
Etcd test data
](
#etcd-test-data
)
-
[
Run integration tests
](
#run-integration-tests
)
-
[
Run a specific integration test
](
#run-a-specific-integration-test
)
-
[
End-to-End tests
](
#end-to-end-tests
)
...
...
@@ -213,6 +214,14 @@ grep -E "image.*etcd" cluster/saltbase/etcd/etcd.manifest # Find version
echo export
PATH
=
"
$PATH
:<LOCATION>"
>>
~/.profile
# Add to PATH
```
### Etcd test data
Many tests start an etcd server internally, storing test data in the operating system's temporary directory.
If you see test failures because the temporary directory does not have sufficient space,
or is on a volume with unpredictable write latency, you can override the test data directory
for those internal etcd instances with the
`TEST_ETCD_DIR`
environment variable.
### Run integration tests
The integration tests are run using the
`hack/test-integration.sh`
script.
...
...
pkg/storage/etcd/testing/utils.go
View file @
e43e58c7
...
...
@@ -113,7 +113,13 @@ func configureTestCluster(t *testing.T, name string) *EtcdTestServer {
t
.
Fatal
(
err
)
}
m
.
CertificatesDir
,
err
=
ioutil
.
TempDir
(
os
.
TempDir
(),
"etcd_certificates"
)
// Allow test launches to control where etcd data goes, for space or performance reasons
baseDir
:=
os
.
Getenv
(
"TEST_ETCD_DIR"
)
if
len
(
baseDir
)
==
0
{
baseDir
=
os
.
TempDir
()
}
m
.
CertificatesDir
,
err
=
ioutil
.
TempDir
(
baseDir
,
"etcd_certificates"
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
...
...
@@ -138,7 +144,7 @@ func configureTestCluster(t *testing.T, name string) *EtcdTestServer {
}
m
.
Name
=
name
m
.
DataDir
,
err
=
ioutil
.
TempDir
(
os
.
TempDir
()
,
"etcd"
)
m
.
DataDir
,
err
=
ioutil
.
TempDir
(
baseDir
,
"etcd"
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment