rename `internal/test` to idiomatic `testdata`

This commit is contained in:
Serge Smertin 2022-05-23 11:46:37 +02:00
parent 0d76ab3d28
commit 95a68937fe
11 changed files with 12 additions and 12 deletions

View File

@ -11,12 +11,12 @@ import (
func TestFindProjectRoot(t *testing.T) {
wd, _ := os.Getwd()
defer os.Chdir(wd)
err := os.Chdir("internal/test/a/b/c")
err := os.Chdir("testdata/a/b/c")
assert.NoError(t, err)
root, err := findProjectRoot()
assert.NoError(t, err)
assert.Equal(t, fmt.Sprintf("%s/internal/test", wd), root)
assert.Equal(t, fmt.Sprintf("%s/testdata", wd), root)
}
func TestFindProjectRootInRoot(t *testing.T) {
@ -37,7 +37,7 @@ func TestGetGitOrigin(t *testing.T) {
func TestLoadProjectConf(t *testing.T) {
wd, _ := os.Getwd()
defer os.Chdir(wd)
os.Chdir("internal/test/a/b/c")
os.Chdir("testdata/a/b/c")
prj, err := loadProjectConf()
assert.NoError(t, err)

View File

@ -15,7 +15,7 @@ func TestFreeze(t *testing.T) {
}
func TestPyInlineX(t *testing.T) {
defer chdirAndBack("internal/test/simple-python-wheel")()
defer chdirAndBack("testdata/simple-python-wheel")()
dist, err := ReadDistribution(context.Background())
assert.NoError(t, err)
assert.Equal(t, "dummy", dist.Name)

View File

@ -9,13 +9,13 @@ import (
)
func TestWheel(t *testing.T) {
wheel, err := BuildWheel(context.Background(), "internal/test/simple-python-wheel")
wheel, err := BuildWheel(context.Background(), "testdata/simple-python-wheel")
assert.NoError(t, err)
assert.Equal(t, "internal/test/simple-python-wheel/dist/dummy-0.0.1-py3-none-any.whl", wheel)
assert.Equal(t, "testdata/simple-python-wheel/dist/dummy-0.0.1-py3-none-any.whl", wheel)
noFile(t, "internal/test/simple-python-wheel/dummy.egg-info")
noFile(t, "internal/test/simple-python-wheel/__pycache__")
noFile(t, "internal/test/simple-python-wheel/build")
noFile(t, "testdata/simple-python-wheel/dummy.egg-info")
noFile(t, "testdata/simple-python-wheel/__pycache__")
noFile(t, "testdata/simple-python-wheel/build")
}
func noFile(t *testing.T, name string) {

View File

@ -11,7 +11,7 @@ import (
func TestSomething(t *testing.T) {
ctx := context.Background()
tf, err := newTerraform(ctx, "internal/test/simplest", map[string]string{
tf, err := newTerraform(ctx, "testdata/simplest", map[string]string{
"DATABRICKS_HOST": "..",
"DATABRICKS_TOKEN": "..",
})
@ -36,8 +36,8 @@ func TestSomething(t *testing.T) {
if r.Type != "databricks_job" {
continue
}
// TODO: validate that libraries on jobs defined in *.tf and libraries
// in `install_requires` defined in setup.py are the same. Exist with
// TODO: validate that libraries on jobs defined in *.tf and libraries
// in `install_requires` defined in setup.py are the same. Exist with
// the explanatory error otherwise.
found = true
// resource "databricks_job" "this"