elastic / elastic-package

elastic-package - Command line tool for developing Elastic Integrations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Coverage reports for asset tests are not generated in input packages

mrodm opened this issue · comments

Relates #1595

In #1595 , it is added support to create coverage reports for input packages. Even that, coverage report for asset tests it is not generated since it is not generated a list of assets for input packages.

This asset tests are based on kibana and elasticsearch assets. In case of input packages, there are no kibana assets, but there should be elasticsearch assets (e.g. index templates). Currently, the logic just takes into account generating that list based on data stream paths from the package. This is valid for integration packages but not for input packages.

func loadElasticsearchAssets(pkgRootPath string) ([]Asset, error) {
packageManifestPath := filepath.Join(pkgRootPath, PackageManifestFile)
pkgManifest, err := ReadPackageManifest(packageManifestPath)
if err != nil {
return nil, fmt.Errorf("reading package manifest file failed: %w", err)
}
dataStreamManifestPaths, err := filepath.Glob(filepath.Join(pkgRootPath, "data_stream", "*", DataStreamManifestFile))
if err != nil {
return nil, fmt.Errorf("could not read data stream manifest file paths: %w", err)
}
var assets []Asset
for _, dsManifestPath := range dataStreamManifestPaths {

@mrodm Should be a somewhat small fix, right? Tentatively putting this in the next sprint (or feel free to pull it ahead into this one if you'd like).