Skip to content

Commit

Permalink
run flaky tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PrajwolAmatya committed Dec 27, 2024
1 parent 0f087dd commit 7c548a5
Show file tree
Hide file tree
Showing 2 changed files with 2,312 additions and 40 deletions.
75 changes: 35 additions & 40 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ OCIS_FED_DOMAIN = "%s:10200" % FED_OCIS_SERVER_NAME
# configuration
config = {
"cs3ApiTests": {
"skip": False,
"skip": True,
},
"wopiValidatorTests": {
"skip": False,
"skip": True,
},
"k6LoadTests": {
"skip": False,
"skip": True,
},
"localApiTests": {
"basic": {
Expand All @@ -89,76 +89,76 @@ config = {
"apiLocks",
"apiActivities",
],
"skip": False,
"skip": True,
},
"graph": {
"suites": [
"apiGraph",
"apiServiceAvailability",
],
"skip": False,
"skip": True,
"withRemotePhp": [True],
},
"graphUserGroup": {
"suites": [
"apiGraphUserGroup",
],
"skip": False,
"skip": True,
"withRemotePhp": [True],
},
"spaces": {
"suites": [
"apiSpaces",
],
"skip": False,
"skip": True,
},
"spacesShares": {
"suites": [
"apiSpacesShares",
],
"skip": False,
"skip": True,
},
"spacesDavOperation": {
"suites": [
"apiSpacesDavOperation",
],
"skip": False,
"skip": True,
},
"search1": {
"suites": [
"apiSearch1",
],
"skip": False,
"skip": True,
},
"search2": {
"suites": [
"apiSearch2",
],
"skip": False,
"skip": True,
},
"sharingNg": {
"suites": [
"apiReshare",
"apiSharingNg1",
"apiSharingNg2",
],
"skip": False,
"skip": True,
},
"sharingNgShareInvitation": {
"suites": [
"apiSharingNgShareInvitation",
],
"skip": False,
"skip": True,
},
"sharingNgLinkShare": {
"suites": [
"apiSharingNgLinkSharePermission",
"apiSharingNgLinkShareRoot",
],
"skip": False,
"skip": True,
},
"accountsHashDifficulty": {
"skip": False,
"skip": True,
"suites": [
"apiAccountsHashDifficulty",
],
Expand All @@ -168,7 +168,7 @@ config = {
"suites": [
"apiNotification",
],
"skip": False,
"skip": True,
"withRemotePhp": [True],
"emailNeeded": True,
"extraEnvironment": {
Expand All @@ -188,7 +188,7 @@ config = {
"suites": [
"apiAntivirus",
],
"skip": False,
"skip": True,
"antivirusNeeded": True,
"extraServerEnvironment": {
"ANTIVIRUS_SCANNER_TYPE": "clamav",
Expand All @@ -203,14 +203,14 @@ config = {
"suites": [
"apiSearchContent",
],
"skip": False,
"skip": True,
"tikaNeeded": True,
},
"ocm": {
"suites": [
"apiOcm",
],
"skip": False,
"skip": True,
"withRemotePhp": [True],
"federationServer": True,
"emailNeeded": True,
Expand All @@ -236,7 +236,7 @@ config = {
"suites": [
"apiCollaboration",
],
"skip": False,
"skip": True,
"collaborationServiceNeeded": True,
"extraServerEnvironment": {
"GATEWAY_GRPC_ADDR": "0.0.0.0:9142",
Expand All @@ -246,7 +246,7 @@ config = {
"suites": [
"apiAuthApp",
],
"skip": False,
"skip": True,
"withRemotePhp": [True],
"extraServerEnvironment": {
"OCIS_ADD_RUN_SERVICES": "auth-app",
Expand All @@ -257,7 +257,7 @@ config = {
"suites": [
"cliCommands",
],
"skip": False,
"skip": True,
"withRemotePhp": [True],
"antivirusNeeded": True,
"extraServerEnvironment": {
Expand All @@ -269,25 +269,23 @@ config = {
},
},
"apiTests": {
"numberOfParts": 7,
"skip": False,
"skipExceptParts": [],
},
"e2eTests": {
"part": {
"skip": False,
"skip": True,
"totalParts": 4, # divide and run all suites in parts (divide pipelines)
"xsuites": ["search", "app-provider", "oidc", "ocm"], # suites to skip
},
"search": {
"skip": False,
"skip": True,
"suites": ["search"], # suites to run
"tikaNeeded": True,
},
},
"e2eMultiService": {
"testSuites": {
"skip": False,
"skip": True,
"suites": [
"smoke",
"shares",
Expand All @@ -310,8 +308,8 @@ config = {
"dockerReleases": {
"architectures": ["arm64", "amd64"],
},
"litmus": True,
"codestyle": True,
"litmus": False,
"codestyle": False,
}

# volume for steps to cache Go dependencies between steps of a pipeline
Expand Down Expand Up @@ -1210,15 +1208,15 @@ def wopiValidatorTests(ctx, storage, wopiServerType, accounts_hash_difficulty =
},
}

def coreApiTests(ctx, part_number = 1, number_of_parts = 1, with_remote_php = False, storage = "ocis", accounts_hash_difficulty = 4):
def coreApiTests(ctx, with_remote_php = False, storage = "ocis", accounts_hash_difficulty = 4):
filterTags = "~@skipOnGraph&&~@skipOnOcis-%s-Storage" % ("OC" if storage == "owncloud" else "OCIS")
test_dir = "%s/tests/acceptance" % dirs["base"]
expected_failures_file = "%s/expected-failures-API-on-%s-storage.md" % (test_dir, storage.upper())

return {
"kind": "pipeline",
"type": "docker",
"name": "Core-API-Tests-%s%s" % (part_number, "-withoutRemotePhp" if not with_remote_php else ""),
"name": "Core-API-Tests%s" % ("-withoutRemotePhp" if not with_remote_php else ""),
"platform": {
"os": "linux",
"arch": "amd64",
Expand All @@ -1228,16 +1226,15 @@ def coreApiTests(ctx, part_number = 1, number_of_parts = 1, with_remote_php = Fa
ocisServer(storage, accounts_hash_difficulty, with_wrapper = True) +
[
{
"name": "oC10ApiTests-%s" % part_number,
"name": "oC10ApiTests",
"image": OC_CI_PHP % DEFAULT_PHP_VERSION,
"environment": {
"TEST_SERVER_URL": OCIS_URL,
"OCIS_REVA_DATA_ROOT": "%s" % (dirs["ocisRevaDataRoot"] if storage == "owncloud" else ""),
"SEND_SCENARIO_LINE_REFERENCES": "true",
"STORAGE_DRIVER": storage,
"BEHAT_FEATURE": "tests/acceptance/features/coreApiShareOperationsToShares2/test.feature",
"BEHAT_FILTER_TAGS": filterTags,
"DIVIDE_INTO_NUM_PARTS": number_of_parts,
"RUN_PART": part_number,
"ACCEPTANCE_TEST_TYPE": "core-api",
"EXPECTED_FAILURES_FILE": expected_failures_file,
"UPLOAD_DELETE_WAIT_TIME": "1" if storage == "owncloud" else 0,
Expand All @@ -1264,8 +1261,8 @@ def coreApiTests(ctx, part_number = 1, number_of_parts = 1, with_remote_php = Fa

def apiTests(ctx):
pipelines = []
debugParts = config["apiTests"]["skipExceptParts"]
debugPartsEnabled = (len(debugParts) != 0)
# debugParts = config["apiTests"]["skipExceptParts"]
# debugPartsEnabled = (len(debugParts) != 0)

with_remote_php = [True]
if ctx.build.event == "cron" or "full-ci" in ctx.build.title.lower():
Expand All @@ -1275,10 +1272,8 @@ def apiTests(ctx):
"withRemotePhp": with_remote_php,
}

for runPart in range(1, config["apiTests"]["numberOfParts"] + 1):
for run_with_remote_php in defaults["withRemotePhp"]:
if (not debugPartsEnabled or (debugPartsEnabled and runPart in debugParts)):
pipelines.append(coreApiTests(ctx, runPart, config["apiTests"]["numberOfParts"], run_with_remote_php))
for run_with_remote_php in defaults["withRemotePhp"]:
pipelines.append(coreApiTests(ctx, run_with_remote_php))

return pipelines

Expand Down
Loading

0 comments on commit 7c548a5

Please sign in to comment.