Merge pull request #2106 from owncloud/earlyFail
[Tests-Only]Add earlyFail
This commit is contained in:
1 file changed
+114
-7
+114
-7
@@ -20,22 +20,27 @@ config = {
|
|||||||
],
|
],
|
||||||
"localApiTests": {
|
"localApiTests": {
|
||||||
"skip": False,
|
"skip": False,
|
||||||
|
"earlyFail": True,
|
||||||
},
|
},
|
||||||
"apiTests": {
|
"apiTests": {
|
||||||
"numberOfParts": 10,
|
"numberOfParts": 10,
|
||||||
"skip": False,
|
"skip": False,
|
||||||
"skipExceptParts": [],
|
"skipExceptParts": [],
|
||||||
|
"earlyFail": True,
|
||||||
},
|
},
|
||||||
"uiTests": {
|
"uiTests": {
|
||||||
"filterTags": "@ocisSmokeTest",
|
"filterTags": "@ocisSmokeTest",
|
||||||
"skip": False,
|
"skip": False,
|
||||||
"skipExceptParts": [],
|
"skipExceptParts": [],
|
||||||
|
"earlyFail": True,
|
||||||
},
|
},
|
||||||
"accountsUITests": {
|
"accountsUITests": {
|
||||||
"skip": False,
|
"skip": False,
|
||||||
|
"earlyFail": True,
|
||||||
},
|
},
|
||||||
"settingsUITests": {
|
"settingsUITests": {
|
||||||
"skip": False,
|
"skip": False,
|
||||||
|
"earlyFail": True,
|
||||||
},
|
},
|
||||||
"rocketchat": {
|
"rocketchat": {
|
||||||
"channel": "ocis-internal",
|
"channel": "ocis-internal",
|
||||||
@@ -383,6 +388,11 @@ def uploadScanResults(ctx):
|
|||||||
}
|
}
|
||||||
|
|
||||||
def localApiTests(ctx, storage = "owncloud", suite = "apiBugDemonstration", accounts_hash_difficulty = 4):
|
def localApiTests(ctx, storage = "owncloud", suite = "apiBugDemonstration", accounts_hash_difficulty = 4):
|
||||||
|
earlyFail = config["localApiTests"]["earlyFail"] if "earlyFail" in config["localApiTests"] else False
|
||||||
|
|
||||||
|
if ("full-ci" in ctx.build.title.lower()):
|
||||||
|
earlyFail = False
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"kind": "pipeline",
|
"kind": "pipeline",
|
||||||
"type": "docker",
|
"type": "docker",
|
||||||
@@ -414,7 +424,7 @@ def localApiTests(ctx, storage = "owncloud", suite = "apiBugDemonstration", acco
|
|||||||
],
|
],
|
||||||
"volumes": [stepVolumeOC10Tests],
|
"volumes": [stepVolumeOC10Tests],
|
||||||
},
|
},
|
||||||
],
|
] + buildGithubCommentForBuildStopped("localApiTests-%s-%s" % (suite, storage), earlyFail) + githubComment(earlyFail) + stopBuild(earlyFail),
|
||||||
"services": redisForOCStorage(storage),
|
"services": redisForOCStorage(storage),
|
||||||
"depends_on": getPipelineNames([buildOcisBinaryForTesting(ctx)]),
|
"depends_on": getPipelineNames([buildOcisBinaryForTesting(ctx)]),
|
||||||
"trigger": {
|
"trigger": {
|
||||||
@@ -428,6 +438,11 @@ def localApiTests(ctx, storage = "owncloud", suite = "apiBugDemonstration", acco
|
|||||||
}
|
}
|
||||||
|
|
||||||
def coreApiTests(ctx, part_number = 1, number_of_parts = 1, storage = "owncloud", accounts_hash_difficulty = 4):
|
def coreApiTests(ctx, part_number = 1, number_of_parts = 1, storage = "owncloud", accounts_hash_difficulty = 4):
|
||||||
|
earlyFail = config["apiTests"]["earlyFail"] if "earlyFail" in config["apiTests"] else False
|
||||||
|
|
||||||
|
if ("full-ci" in ctx.build.title.lower()):
|
||||||
|
earlyFail = False
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"kind": "pipeline",
|
"kind": "pipeline",
|
||||||
"type": "docker",
|
"type": "docker",
|
||||||
@@ -460,7 +475,7 @@ def coreApiTests(ctx, part_number = 1, number_of_parts = 1, storage = "owncloud"
|
|||||||
],
|
],
|
||||||
"volumes": [stepVolumeOC10Tests],
|
"volumes": [stepVolumeOC10Tests],
|
||||||
},
|
},
|
||||||
],
|
] + buildGithubCommentForBuildStopped("Core-API-Tests-%s-storage-%s" % (storage, part_number), earlyFail) + githubComment(earlyFail) + stopBuild(earlyFail),
|
||||||
"services": redisForOCStorage(storage),
|
"services": redisForOCStorage(storage),
|
||||||
"depends_on": getPipelineNames([buildOcisBinaryForTesting(ctx)]),
|
"depends_on": getPipelineNames([buildOcisBinaryForTesting(ctx)]),
|
||||||
"trigger": {
|
"trigger": {
|
||||||
@@ -488,6 +503,7 @@ def uiTests(ctx):
|
|||||||
default = {
|
default = {
|
||||||
"filterTags": "",
|
"filterTags": "",
|
||||||
"skip": False,
|
"skip": False,
|
||||||
|
"earlyFail": False,
|
||||||
# only used if 'full-ci' is in build title
|
# only used if 'full-ci' is in build title
|
||||||
"numberOfParts": 10,
|
"numberOfParts": 10,
|
||||||
"skipExceptParts": [],
|
"skipExceptParts": [],
|
||||||
@@ -499,6 +515,10 @@ def uiTests(ctx):
|
|||||||
params[item] = config["uiTests"][item] if item in config["uiTests"] else default[item]
|
params[item] = config["uiTests"][item] if item in config["uiTests"] else default[item]
|
||||||
|
|
||||||
filterTags = params["filterTags"]
|
filterTags = params["filterTags"]
|
||||||
|
earlyFail = params["earlyFail"]
|
||||||
|
|
||||||
|
if ("full-ci" in ctx.build.title.lower()):
|
||||||
|
earlyFail = False
|
||||||
|
|
||||||
if ("full-ci" in ctx.build.title.lower() or ctx.build.event == "tag"):
|
if ("full-ci" in ctx.build.title.lower() or ctx.build.event == "tag"):
|
||||||
numberOfParts = params["numberOfParts"]
|
numberOfParts = params["numberOfParts"]
|
||||||
@@ -510,9 +530,9 @@ def uiTests(ctx):
|
|||||||
pipelines.append(uiTestPipeline(ctx, "", runPart, numberOfParts))
|
pipelines.append(uiTestPipeline(ctx, "", runPart, numberOfParts))
|
||||||
return pipelines
|
return pipelines
|
||||||
else:
|
else:
|
||||||
return [uiTestPipeline(ctx, filterTags)]
|
return [uiTestPipeline(ctx, filterTags, earlyFail)]
|
||||||
|
|
||||||
def uiTestPipeline(ctx, filterTags, runPart = 1, numberOfParts = 1, storage = "ocis", accounts_hash_difficulty = 4):
|
def uiTestPipeline(ctx, filterTags, earlyFail, runPart = 1, numberOfParts = 1, storage = "ocis", accounts_hash_difficulty = 4):
|
||||||
standardFilterTags = "not @skipOnOCIS and not @skip and not @notToImplementOnOCIS and not @federated-server-needed"
|
standardFilterTags = "not @skipOnOCIS and not @skip and not @notToImplementOnOCIS and not @federated-server-needed"
|
||||||
if filterTags == "":
|
if filterTags == "":
|
||||||
finalFilterTags = standardFilterTags
|
finalFilterTags = standardFilterTags
|
||||||
@@ -566,7 +586,7 @@ def uiTestPipeline(ctx, filterTags, runPart = 1, numberOfParts = 1, storage = "o
|
|||||||
"path": "/uploads",
|
"path": "/uploads",
|
||||||
}],
|
}],
|
||||||
},
|
},
|
||||||
],
|
] + buildGithubCommentForBuildStopped("Web-Tests-ocis-%s-storage-%s" % (storage, runPart), earlyFail) + githubComment(earlyFail) + stopBuild(earlyFail),
|
||||||
"services": selenium(),
|
"services": selenium(),
|
||||||
"volumes": [pipelineVolumeOC10Tests] +
|
"volumes": [pipelineVolumeOC10Tests] +
|
||||||
[{
|
[{
|
||||||
@@ -584,6 +604,11 @@ def uiTestPipeline(ctx, filterTags, runPart = 1, numberOfParts = 1, storage = "o
|
|||||||
}
|
}
|
||||||
|
|
||||||
def accountsUITests(ctx, storage = "ocis", accounts_hash_difficulty = 4):
|
def accountsUITests(ctx, storage = "ocis", accounts_hash_difficulty = 4):
|
||||||
|
earlyFail = config["accountsUITests"]["earlyFail"] if "earlyFail" in config["accountsUITests"] else False
|
||||||
|
|
||||||
|
if ("full-ci" in ctx.build.title.lower()):
|
||||||
|
earlyFail = False
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"kind": "pipeline",
|
"kind": "pipeline",
|
||||||
"type": "docker",
|
"type": "docker",
|
||||||
@@ -630,7 +655,7 @@ def accountsUITests(ctx, storage = "ocis", accounts_hash_difficulty = 4):
|
|||||||
"path": "/uploads",
|
"path": "/uploads",
|
||||||
}],
|
}],
|
||||||
},
|
},
|
||||||
],
|
] + buildGithubCommentForBuildStopped("accountsUITests", earlyFail) + githubComment(earlyFail) + stopBuild(earlyFail),
|
||||||
"services": selenium(),
|
"services": selenium(),
|
||||||
"volumes": [stepVolumeOC10Tests] +
|
"volumes": [stepVolumeOC10Tests] +
|
||||||
[{
|
[{
|
||||||
@@ -648,6 +673,11 @@ def accountsUITests(ctx, storage = "ocis", accounts_hash_difficulty = 4):
|
|||||||
}
|
}
|
||||||
|
|
||||||
def settingsUITests(ctx, storage = "ocis", accounts_hash_difficulty = 4):
|
def settingsUITests(ctx, storage = "ocis", accounts_hash_difficulty = 4):
|
||||||
|
earlyFail = config["settingsUITests"]["earlyFail"] if "earlyFail" in config["settingsUITests"] else False
|
||||||
|
|
||||||
|
if ("full-ci" in ctx.build.title.lower()):
|
||||||
|
earlyFail = False
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"kind": "pipeline",
|
"kind": "pipeline",
|
||||||
"type": "docker",
|
"type": "docker",
|
||||||
@@ -692,7 +722,7 @@ def settingsUITests(ctx, storage = "ocis", accounts_hash_difficulty = 4):
|
|||||||
"path": "/uploads",
|
"path": "/uploads",
|
||||||
}],
|
}],
|
||||||
},
|
},
|
||||||
],
|
] + buildGithubCommentForBuildStopped("settingsUITests", earlyFail) + githubComment(earlyFail) + stopBuild(earlyFail),
|
||||||
"services": [
|
"services": [
|
||||||
{
|
{
|
||||||
"name": "redis",
|
"name": "redis",
|
||||||
@@ -715,6 +745,83 @@ def settingsUITests(ctx, storage = "ocis", accounts_hash_difficulty = 4):
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def stopBuild(earlyFail):
|
||||||
|
if (earlyFail):
|
||||||
|
return [{
|
||||||
|
"name": "stop-build",
|
||||||
|
"image": "drone/cli:alpine",
|
||||||
|
"pull": "always",
|
||||||
|
"environment": {
|
||||||
|
"DRONE_SERVER": "https://drone.owncloud.com",
|
||||||
|
"DRONE_TOKEN": {
|
||||||
|
"from_secret": "drone_token",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"commands": [
|
||||||
|
"drone build stop owncloud/ocis ${DRONE_BUILD_NUMBER}",
|
||||||
|
],
|
||||||
|
"when": {
|
||||||
|
"status": [
|
||||||
|
"failure",
|
||||||
|
],
|
||||||
|
"event": [
|
||||||
|
"pull_request",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
}]
|
||||||
|
|
||||||
|
else:
|
||||||
|
return []
|
||||||
|
|
||||||
|
def buildGithubCommentForBuildStopped(alternateSuiteName, earlyFail):
|
||||||
|
if (earlyFail):
|
||||||
|
return [{
|
||||||
|
"name": "build-github-comment-buildStop",
|
||||||
|
"image": "owncloud/ubuntu:16.04",
|
||||||
|
"pull": "always",
|
||||||
|
"commands": [
|
||||||
|
'echo "<details><summary>:boom: Acceptance tests <strong>%s</strong> failed. The build is cancelled...</summary>\\n\\n" >> /drone/src/comments.file' % alternateSuiteName,
|
||||||
|
],
|
||||||
|
"when": {
|
||||||
|
"status": [
|
||||||
|
"failure",
|
||||||
|
],
|
||||||
|
"event": [
|
||||||
|
"pull_request",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
}]
|
||||||
|
|
||||||
|
else:
|
||||||
|
return []
|
||||||
|
|
||||||
|
def githubComment(earlyFail):
|
||||||
|
if (earlyFail):
|
||||||
|
return [{
|
||||||
|
"name": "github-comment",
|
||||||
|
"image": "jmccann/drone-github-comment:1",
|
||||||
|
"pull": "if-not-exists",
|
||||||
|
"settings": {
|
||||||
|
"message_file": "/drone/src/comments.file",
|
||||||
|
},
|
||||||
|
"environment": {
|
||||||
|
"GITHUB_TOKEN": {
|
||||||
|
"from_secret": "github_token",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"when": {
|
||||||
|
"status": [
|
||||||
|
"failure",
|
||||||
|
],
|
||||||
|
"event": [
|
||||||
|
"pull_request",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
}]
|
||||||
|
|
||||||
|
else:
|
||||||
|
return []
|
||||||
|
|
||||||
def dockerReleases(ctx):
|
def dockerReleases(ctx):
|
||||||
pipelines = []
|
pipelines = []
|
||||||
for arch in config["dockerReleases"]["architectures"]:
|
for arch in config["dockerReleases"]["architectures"]:
|
||||||
|
|||||||
Reference in new issue
Block a user