Skip to content
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

Introduce upgrade tests from released versions #2955

Merged
merged 17 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion pkg/testing/fixture.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ type Fixture struct {
allowErrs bool
connectTimout time.Duration

workDir string
srcPackage string
workDir string

installed bool
installOpts *InstallOpts
Expand Down Expand Up @@ -153,6 +154,7 @@ func (f *Fixture) Prepare(ctx context.Context, components ...UsableComponent) er
if err != nil {
return err
}
f.srcPackage = src
filename := filepath.Base(src)
name, _, err := splitFileType(filename)
if err != nil {
Expand Down Expand Up @@ -191,6 +193,15 @@ func (f *Fixture) WorkDir() string {
return f.workDir
}

// SrcPackage returns the location on disk of the elastic agent package used by this fixture.
func (f *Fixture) SrcPackage(ctx context.Context) (string, error) {
err := f.ensurePrepared(ctx)
if err != nil {
return "", err
}
return f.srcPackage, nil
}

func ExtractArtifact(l Logger, artifactFile, outputDir string) error {
filename := filepath.Base(artifactFile)
_, ext, err := splitFileType(filename)
Expand Down
Loading
Loading