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

check IE tests made in #2082 #2208

Closed
wants to merge 15 commits into from
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
117 changes: 71 additions & 46 deletions .drone.starlark
Original file line number Diff line number Diff line change
Expand Up @@ -14,39 +14,15 @@ config = {
'yarnlint': True,

'acceptance': {
'webUI': {
'suites': [
'webUIFavorites',
'webUIFiles',
'webUILogin',
'webUINotifications',
'webUIPrivateLinks',
'webUIRenameFiles',
'webUIRenameFolders',
'webUISharingInternalGroups',
'webUISharingInternalUsers',
'webUISharingPublic',
'webUITrashbin',
'webUIUpload',
],
},
'webUI-XGA': {
'suites': {
'all': 'XGAPortrait',
},
'extraEnvironment': {
'SCREEN_RESOLUTION': '768x1024'
},
'filterTags': '@smokeTest and not @skipOnXGAPortraitResolution and not @skip'
},
'webUI-iPhone': {
'webUI-IE11': {
'suites': {
'all': 'iPhone',
'webUI[R,T,F]*': 'Rename-Trash-Files',
'webUISharing*': 'Sharing',
},
'extraEnvironment': {
'SCREEN_RESOLUTION': '375x812'
},
'filterTags': '@smokeTest and not @skipOnIphoneResolution and not @skip'
'browsers': [
'IE11',
],
'filterTags': '@smokeTest and not @skip and not @skipOnIE',
},
},

Expand Down Expand Up @@ -178,6 +154,7 @@ def acceptance():
'browsers': ['chrome'],
'databases': ['mysql:5.5'],
'extraEnvironment': {},
'cronOnly': False,
'filterTags': 'not @skip',
'logLevel': '2',
}
Expand All @@ -195,7 +172,7 @@ def acceptance():
else:
suites = matrix['suites']

for suite, shortSuiteName in suites.items():
for suite, alternateSuiteName in suites.items():

params = {}
for item in default:
Expand All @@ -205,7 +182,7 @@ def acceptance():
for browser in params['browsers']:
for db in params['databases']:
browserString = '' if browser == '' else '-' + browser
name = 'acceptance-%s%s' % (shortSuiteName, browserString)
name = 'acceptance-%s%s' % (alternateSuiteName, browserString)
maxLength = 50
nameLength = len(name)
if nameLength > maxLength:
Expand All @@ -228,14 +205,16 @@ def acceptance():
setupServerAndApp(params['logLevel']) +
owncloudLog() +
fixPermissions() +
runWebuiAcceptanceTests(suite, params['filterTags'], params['extraEnvironment']) +
uploadScreenshots() +
buildGithubComment(suite, shortSuiteName) +
githubComment(),
runWebuiAcceptanceTests(suite, alternateSuiteName, params['filterTags'], params['extraEnvironment'], browser) +
(
uploadScreenshots() +
buildGithubComment(suite, alternateSuiteName) +
githubComment()
if isLocalBrowser(browser) else []),
'services':
phoenixService() +
owncloudService() +
browserService(browser) +
browserService(alternateSuiteName, browser) +
databaseService(db),
'depends_on': [],
'trigger': {
Expand All @@ -251,6 +230,9 @@ def acceptance():
for branch in config['branches']:
result['trigger']['ref'].append('refs/heads/%s' % branch)

if (params['cronOnly']):
result['trigger']['event'] = ['cron']

pipelines.append(result)

if errorFound:
Expand Down Expand Up @@ -334,21 +316,39 @@ def databaseService(db):

return []

def browserService(name):
if name == 'chrome':
def browserService(alternateSuiteName, browser):
if browser == 'chrome':
return [{
'name': 'selenium',
'image': 'selenium/standalone-chrome-debug:latest',
'pull': 'always',
}]

if name == 'firefox':
if browser == 'firefox':
return [{
'name': 'selenium',
'image': 'selenium/standalone-firefox-debug:latest',
'pull': 'always',
}]

if not isLocalBrowser(browser):
return [{
'name': 'saucelabs',
'image': 'henrrich/docker-sauce-connect:latest',
'pull': 'if-not-exists',
'environment': {
'SAUCE_USERNAME': {
'from_secret': 'sauce_username'
},
'SAUCE_ACCESS_KEY': {
'from_secret': 'sauce_access_key'
},
},
'commands': [
'/usr/local/sauce-connect/bin/sc -i %s' % getSaucelabsTunnelName(alternateSuiteName, browser)
]
}]

return []

def phoenixService():
Expand Down Expand Up @@ -419,6 +419,19 @@ def getDbDatabase(db):

return 'owncloud'

def getSaucelabsTunnelName(alternateSuiteName, browser):
return '${DRONE_BUILD_NUMBER}-acceptance-%s-%s' % (alternateSuiteName, browser)

def getSaucelabsBrowserName(browser):
if (browser == 'IE11'):
return 'internet explorer'
if (browser == 'Edge'):
return 'MicrosoftEdge'
return browser

def isLocalBrowser(browser):
return ((browser == 'chrome') or (browser == 'firefox'))

def installCore(version, db):
host = getDbName(db)
dbType = host
Expand Down Expand Up @@ -605,14 +618,26 @@ def owncloudLog():
]
}]

def runWebuiAcceptanceTests(suite, filterTags, extraEnvironment):
def runWebuiAcceptanceTests(suite, alternateSuiteName, filterTags, extraEnvironment, browser):
environment = {}
if (filterTags != ''):
environment['TEST_TAGS'] = filterTags
if (suite != 'all'):
environment['TEST_CONTEXT'] = suite
for env in extraEnvironment:
environment[env] = extraEnvironment[env]
if isLocalBrowser(browser):
if (suite != 'all'):
environment['TEST_CONTEXT'] = suite
else:
environment['TEST_CONTEXT'] = suite
environment['BROWSER_NAME'] = getSaucelabsBrowserName(browser)
environment['SELENIUM_PORT'] = '4445'
environment['SAUCELABS_TUNNEL_NAME'] = getSaucelabsTunnelName(alternateSuiteName, browser)
environment['SAUCE_USERNAME'] = {
'from_secret': 'sauce_username'
}
environment['SAUCE_ACCESS_KEY'] = {
'from_secret': 'sauce_access_key'
}

return [{
'name': 'webui-acceptance-tests',
Expand Down Expand Up @@ -655,14 +680,14 @@ def uploadScreenshots():
},
}]

def buildGithubComment(suite, shortSuiteName):
def buildGithubComment(suite, alternateSuiteName):
return [{
'name': 'build-github-comment',
'image': 'owncloud/ubuntu:16.04',
'pull': 'always',
'commands': [
'cd /var/www/owncloud/phoenix/tests/reports/screenshots/',
'echo "<details><summary>:boom: Acceptance tests <strong>%s</strong> failed. Please find the screenshots inside ...</summary>\\n\\n${DRONE_BUILD_LINK}/${DRONE_JOB_NUMBER}\\n\\n<p>\\n\\n" >> comments.file' % shortSuiteName,
'echo "<details><summary>:boom: Acceptance tests <strong>%s</strong> failed. Please find the screenshots inside ...</summary>\\n\\n${DRONE_BUILD_LINK}/${DRONE_JOB_NUMBER}\\n\\n<p>\\n\\n" >> comments.file' % alternateSuiteName,
'for f in *.png; do echo \'!\'"[$f](https://minio.owncloud.com/phoenix/screenshots/${DRONE_BUILD_NUMBER}/$f)" >> comments.file; done',
'echo "\n</p></details>" >> comments.file',
'more comments.file',
Expand Down
Loading