Skip to content
This repository was archived by the owner on Jul 14, 2026. It is now read-only.
Closed
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
85 changes: 64 additions & 21 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -2454,32 +2454,75 @@ def buildGithubCommentForBuildStopped(suite):
}]

def githubComment(alternateSuiteName):
prefix = "Results for <strong>%s</strong> ${DRONE_BUILD_LINK}/${DRONE_JOB_NUMBER}${DRONE_STAGE_NUMBER}/1" % alternateSuiteName
return [{
"name": "github-comment",
"image": "jmccann/drone-github-comment:1",
"pull": "if-not-exists",
"settings": {
"message_file": "%s/comments.file" % dir["web"],
prefixGitHub = "Results for <strong>%s</strong> ${DRONE_BUILD_LINK}/${DRONE_JOB_NUMBER}${DRONE_STAGE_NUMBER}/1" % alternateSuiteName
prefixRocketChat = "Results for *%s* ${DRONE_BUILD_LINK}/${DRONE_JOB_NUMBER}${DRONE_STAGE_NUMBER}/1" % alternateSuiteName
return [
{
"name": "copy-passedOnRetry",
"image": "owncloud/ubuntu:20.04",
"pull": "always",
"commands": [
"touch %s/rocketChat.file" % dir["web"],
"if [ -s %s/passedOnRetry.file ]; then cat %s/passedOnRetry.file >> %s/comments.file; fi" % (dir["web"], dir["web"], dir["web"]),
"if [ -s %s/passedOnRetry.file ]; then echo '%s' | cat - %s/passedOnRetry.file > %s/rocketChat.file; fi" % (dir["web"], prefixRocketChat, dir["web"], dir["web"]),
],
"when": {
"status": [
"success",
"failure",
],
"event": [
"pull_request",
],
},
},
"environment": {
"GITHUB_TOKEN": {
"from_secret": "github_token",
{
"name": "notify-passedOnRetry",
"image": "plugins/slack:1",
"pull": "always",
"settings": {
"webhook": {
"from_secret": config["rocketchat"]["from_secret"],
},
"channel": config["rocketchat"]["channel"],
"template": "file:%s/rocketChat.file" % dir["web"],
},
"when": {
"status": [
"success",
"failure",
],
"event": [
"pull_request",
],
},
},
"commands": [
"if [ -s /var/www/owncloud/web/comments.file ]; then echo '%s' | cat - comments.file > temp && mv temp comments.file && /bin/drone-github-comment; fi" % prefix,
],
"when": {
"status": [
"success",
"failure",
],
"event": [
"pull_request",
{
"name": "github-comment",
"image": "jmccann/drone-github-comment:1",
"pull": "if-not-exists",
"settings": {
"message_file": "%s/comments.file" % dir["web"],
},
"environment": {
"GITHUB_TOKEN": {
"from_secret": "github_token",
},
},
"commands": [
"if [ -s /var/www/owncloud/web/comments.file ]; then echo '%s' | cat - comments.file > temp && mv temp comments.file && /bin/drone-github-comment; fi" % prefixGitHub,
],
"when": {
"status": [
"success",
"failure",
],
"event": [
"pull_request",
],
},
},
}]
]

def example_deploys(ctx):
latest_configs = [
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ tests/testing-app
# acceptance test artifacts
logfile.txt
comments.file
passedOnRetry.file

# drone CI is in .drone.star, do not let someone accidentally commit a local .drone.yml
.drone.yml
Expand Down
8 changes: 4 additions & 4 deletions tests/acceptance/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ SCRIPT_PATH=$(dirname "$0")
SCRIPT_PATH=$( cd "${SCRIPT_PATH}" && pwd ) # normalized and made absolute
FEATURES_DIR="${SCRIPT_PATH}/features"

COMMENTS_FILE="${COMMENTS_FILE:-comments.file}"
PASSED_ON_RETRY_FILE="${PASSED_ON_RETRY_FILE:-passedOnRetry.file}"

rm -rf logfile.txt "$COMMENTS_FILE"
rm -rf logfile.txt "$PASSED_ON_RETRY_FILE"

echo 'run.sh: running acceptance-tests-drone'

Expand Down Expand Up @@ -240,9 +240,9 @@ if [ ${#SINGLE_FAILED_SCENARIOS[@]} -ne 0 ]
then
echo ""
echo ""
echo "The following scenarios passed on retry:" | tee -a "$COMMENTS_FILE"
echo "The following scenarios passed on retry:" | tee -a "$PASSED_ON_RETRY_FILE"
echo "-------------------------------"
for KEY in "${!SINGLE_FAILED_SCENARIOS[@]}"; do echo "- $KEY" | tee -a "$COMMENTS_FILE"; done
for KEY in "${!SINGLE_FAILED_SCENARIOS[@]}"; do echo "- $KEY" | tee -a "$PASSED_ON_RETRY_FILE"; done
echo "-------------------------------"
fi

Expand Down