-
Notifications
You must be signed in to change notification settings - Fork 126
Update package name used in test folders - Asset runner #2517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
💚 Build Succeeded
cc @mrodm |
testers := []testrunner.Tester{ | ||
NewAssetTester(AssetTesterOptions{ | ||
PackageRootPath: r.packageRootPath, | ||
KibanaClient: r.kibanaClient, | ||
TestFolder: testrunner.TestFolder{Package: r.packageRootPath}, | ||
TestFolder: testrunner.TestFolder{Package: pkg}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same change that it is applied in other test runners or testers:
elastic-package/internal/testrunner/testrunner.go
Lines 232 to 238 in ef09037
for _, dataStream := range dataStreams { | |
folders = append(folders, TestFolder{ | |
Path: filepath.Join(dataStreamsPath, dataStream, "_dev", "test", string(testType)), | |
Package: filepath.Base(packageRootPath), | |
DataStream: dataStream, | |
}) | |
} |
elastic-package/internal/testrunner/testrunner.go
Lines 293 to 304 in ef09037
_, pkg := filepath.Split(packageRootPath) | |
for idx, p := range paths { | |
dataStream := ExtractDataStreamFromPath(p, packageRootPath) | |
folder := TestFolder{ | |
Path: p, | |
Package: pkg, | |
DataStream: dataStream, | |
} | |
folders[idx] = folder | |
} |
@@ -146,7 +146,7 @@ func (r *tester) run(ctx context.Context) ([]testrunner.TestResult, error) { | |||
for _, e := range expectedAssets { | |||
rc := testrunner.NewResultComposer(testrunner.TestResult{ | |||
Name: fmt.Sprintf("%s %s is loaded", e.Type, e.ID), | |||
Package: installedPackage.Name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
installedPackage.Name
is the name set in the manifest.yml
, but this could be different from the package folder name. As it happens, for instance, with the sql_input
package in the integrations repository (link):
- Folder name:
sql_input
- Package name in the manifest:
sql
Ideally we should use the name in the manifest as package name, but I see the inconveniences. Maybe at some point we can have both values, the name in the manifest, and the path information. |
This PR updates the package strings set for the TestFolders in the Asset Runner/Tester to be the same as in the other tests (policy, system, static and pipeline).
This mainly affects those packages whose folder name is different of the
name
specified in theirmanfiest.yml
.This package name is used in the xUnit reports and it can be seen the difference in those values for the asset tests
classname
attribute: