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

feat: Small changes mostly to load-test needed to run at scale #1454

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion pkg/clients/github/repositories.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ func (g *Github) ForkRepository(sourceName, targetName string) (*github.Reposito
return false, fmt.Errorf("Error forking %s/%s: %v", g.organization, sourceName, err)
}
return true, nil
}, time.Second * 2, time.Minute * 30)
}, time.Second * 2, time.Minute * 5)
if err1 != nil {
return nil, fmt.Errorf("Failed waiting for repo %s/%s: %v", g.organization, sourceName, err1)
}
Expand Down
1 change: 1 addition & 0 deletions pkg/utils/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ func CreateDockerConfigFile(base64EncodedString string) error {
func GetContainerLogs(ki kubernetes.Interface, podName, containerName, namespace string) (string, error) {
podLogOpts := corev1.PodLogOptions{
Container: containerName,
Timestamps: true,
}

req := ki.CoreV1().Pods(namespace).GetLogs(podName, &podLogOpts)
Expand Down
3 changes: 1 addition & 2 deletions tests/load-tests/ci-scripts/stage/collect-results.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ else
application_stub="${ARTIFACT_DIR}/collected-data/collected-applications.appstudio.redhat.com"
component_stub="${ARTIFACT_DIR}/collected-data/collected-components.appstudio.redhat.com"

for uid in $( seq 1 $CONCURRENCY ); do
username="test-rhtap-$uid"
for username in $( jq --raw-output '.[] | .username' users.json | head -n "$CONCURRENCY" ); do
offline_token=$( cat users.json | jq --raw-output '.[] | select(.username == "'$username'").token' )
api_server=$( cat users.json | jq --raw-output '.[] | select(.username == "'$username'").apiurl' )
sso_server=$( cat users.json | jq --raw-output '.[] | select(.username == "'$username'").ssourl' )
Expand Down
11 changes: 10 additions & 1 deletion tests/load-tests/pkg/journey/handle_repo_templating.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ package journey
import "fmt"
import "strings"
import "regexp"
import "time"

import logging "github.com/konflux-ci/e2e-tests/tests/load-tests/pkg/logging"

import framework "github.com/konflux-ci/e2e-tests/pkg/framework"
import github "github.com/google/go-github/v44/github"
import utils "github.com/konflux-ci/e2e-tests/pkg/utils"

var fileList = []string{"COMPONENT-pull-request.yaml", "COMPONENT-push.yaml"}

Expand Down Expand Up @@ -85,7 +87,14 @@ func ForkRepo(f *framework.Framework, repoUrl, repoRevision, username string) (s
}

// Create fork and make sure it appears
forkRepo, err = f.AsKubeAdmin.CommonController.Github.ForkRepository(sourceName, targetName)
err = utils.WaitUntilWithInterval(func() (done bool, err error) {
forkRepo, err = f.AsKubeAdmin.CommonController.Github.ForkRepository(sourceName, targetName)
if err != nil {
logging.Logger.Debug("Repo forking failed, trying again: %v", err)
return false, nil
}
return true, nil
}, time.Second * 20, time.Minute * 10)
if err != nil {
return "", err
}
Expand Down
Loading