From c13a504d05676f58d851810d2a19939a4527aa57 Mon Sep 17 00:00:00 2001 From: Parajuli Kiran Date: Thu, 3 Jun 2021 09:27:51 +0545 Subject: [PATCH] Run web tests in parts --- .drone.env | 2 +- .drone.star | 44 +++++++++++++++++++++++++------------------- 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/.drone.env b/.drone.env index 6591b072d..5c96204d6 100644 --- a/.drone.env +++ b/.drone.env @@ -3,5 +3,5 @@ CORE_COMMITID=67ce741589a98c61062277666dfbfad38d068c2c CORE_BRANCH=master # The test runner source for UI tests -WEB_COMMITID=8d589e2c51419615560f35f411f4183150c3650d +WEB_COMMITID=21316c14a4e821c2c28b6e642824452b7a74e4e6 WEB_BRANCH=run-with-parts diff --git a/.drone.star b/.drone.star index e428cf1d9..b171e42e4 100644 --- a/.drone.star +++ b/.drone.star @@ -19,23 +19,23 @@ config = { "webdav", ], "localApiTests": { - "skip": False, + "skip": True, }, "apiTests": { "numberOfParts": 10, - "skip": False, + "skip": True, "skipExceptParts": [], }, "uiTests": { "filterTags": "@ocisSmokeTest", - "debugSuites": [], "skip": False, + "skipExceptParts": [], }, "accountsUITests": { - "skip": False, + "skip": True, }, "settingsUITests": { - "skip": False, + "skip": True, }, "rocketchat": { "channel": "ocis-internal", @@ -487,27 +487,32 @@ def apiTests(ctx): def uiTests(ctx): default = { "filterTags": "", - "debugSuites": [], "skip": False, + # only used if 'full ci' is in build title + "numberOfParts": 10, + "skipExceptParts": [], } - params = {} + pipelines = [] + for item in default: params[item] = config["uiTests"][item] if item in config["uiTests"] else default[item] - if len(params["debugSuites"]) != 0: - suiteNames = params["debugSuites"] - return [uiTestPipeline(ctx, suiteName, params["filterTags"]) for suiteName in suiteNames] - return [uiTestPipeline(ctx, None, params["filterTags"])] + filterTags = params["filterTags"] -def uiTestPipeline(ctx, suiteName, filterTags, storage = "ocis", accounts_hash_difficulty = 4): - testFeaturesBaseDir = "tests/acceptance/features/" - if suiteName: - paths = testFeaturesBaseDir + suiteName + if ("full-ci" in ctx.build.title.lower()): + numberOfParts = params["numberOfParts"] + skipExceptParts = params["skipExceptParts"] + debugPartsEnabled = (len(skipExceptParts) != 0) + + for runPart in range(1, numberOfParts + 1): + if (not debugPartsEnabled or (debugPartsEnabled and runPart in skipExceptParts)): + pipelines.append(uiTestPipeline(ctx, "", runPart, numberOfParts)) + return pipelines else: - suiteName = "web-ocis-smoke-tests" - paths = None + return [uiTestPipeline(ctx, filterTags)] +def uiTestPipeline(ctx, filterTags, runPart = 1, numberOfParts = 1, storage = "ocis", accounts_hash_difficulty = 4): standardFilterTags = "not @skipOnOCIS and not @skip and not @notToImplementOnOCIS" if filterTags == "": finalFilterTags = standardFilterTags @@ -517,7 +522,7 @@ def uiTestPipeline(ctx, suiteName, filterTags, storage = "ocis", accounts_hash_d return { "kind": "pipeline", "type": "docker", - "name": suiteName, + "name": "Web-Tests-ocis-%s-storage-%s" % (storage, runPart), "platform": { "os": "linux", "arch": "amd64", @@ -538,7 +543,8 @@ def uiTestPipeline(ctx, suiteName, filterTags, storage = "ocis", accounts_hash_d "TEST_TAGS": finalFilterTags, "LOCAL_UPLOAD_DIR": "/uploads", "NODE_TLS_REJECT_UNAUTHORIZED": 0, - "TEST_PATHS": paths, + "RUN_PART": runPart, + "DIVIDE_INTO_NUM_PARTS": numberOfParts, "EXPECTED_FAILURES_FILE": "/drone/src/tests/acceptance/expected-failures-webUI-on-%s-storage.md" % (storage.upper()), }, "commands": [