From f24a6e96a5e343707977dd3cf4e1a18f02a25001 Mon Sep 17 00:00:00 2001 From: Swikriti Tripathi Date: Wed, 20 Jul 2022 16:14:34 +0545 Subject: [PATCH 1/4] Cache web repo for tests --- .drone.star | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.drone.star b/.drone.star index 2d0e90b630..1f9609602e 100644 --- a/.drone.star +++ b/.drone.star @@ -195,6 +195,7 @@ def main(ctx): test_pipelines = \ cancelPreviousBuilds() + \ + buildCacheWeb(ctx) + \ yarnCache(ctx) + \ [buildOcisBinaryForTesting(ctx)] + \ cacheCoreReposForTesting(ctx) + \ @@ -257,13 +258,30 @@ def main(ctx): pipelineSanityChecks(ctx, pipelines) return pipelines +def buildCacheWeb(ctx): + return [{ + "kind": "pipeline", + "type": "docker", + "name": "cache-web", + "steps": skipIfUnchanged(ctx, "cache") + + installWebTestRunner() + + rebuildBuildArtifactCache(ctx, "web-dist", "webTestRunner"), + "trigger": { + "ref": [ + "refs/heads/master", + "refs/tags/**", + "refs/pull/**", + ], + }, + }] + def yarnCache(ctx): return [{ "kind": "pipeline", "type": "docker", "name": "cache-yarn", "steps": skipIfUnchanged(ctx, "cache") + - installWebTestRunner() + + restoreBuildArtifactCache(ctx, "web-dist", "webTestRunner") + yarnInstallUITests() + rebuildBuildArtifactCache(ctx, "tests-yarn", "webTestRunner/tests/acceptance/.yarn"), "trigger": { @@ -773,7 +791,7 @@ def uiTestPipeline(ctx, filterTags, early_fail, runPart = 1, numberOfParts = 1, "os": "linux", "arch": "amd64", }, - "steps": skipIfUnchanged(ctx, "acceptance-tests") + restoreBuildArtifactCache(ctx, "ocis-binary-amd64", "ocis/bin/ocis") + installWebTestRunner() + + "steps": skipIfUnchanged(ctx, "acceptance-tests") + restoreBuildArtifactCache(ctx, "ocis-binary-amd64", "ocis/bin/ocis") + restoreBuildArtifactCache(ctx, "web-dist", "webTestRunner") + restoreBuildArtifactCache(ctx, "tests-yarn", "webTestRunner/tests/acceptance/.yarn") + yarnInstallUITests() + ocisServer(storage, accounts_hash_difficulty) + waitForSeleniumService() + waitForMiddlewareService() + restoreBuildArtifactCache(ctx, "testing_app", dirs["testing_app"]) + From a6069760ef10fa8a26f59c4b4f0218778ad0260c Mon Sep 17 00:00:00 2001 From: Swikriti Tripathi Date: Wed, 20 Jul 2022 16:26:15 +0545 Subject: [PATCH 2/4] skip piplines --- .drone.star | 51 ++++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/.drone.star b/.drone.star index 1f9609602e..8adfd828a8 100644 --- a/.drone.star +++ b/.drone.star @@ -134,7 +134,7 @@ config = { "dockerReleases": { "architectures": ["arm", "arm64", "amd64"], }, - "litmus": True, + "litmus": False, } # volume for steps to cache Go dependencies between steps of a pipeline @@ -196,11 +196,11 @@ def main(ctx): test_pipelines = \ cancelPreviousBuilds() + \ buildCacheWeb(ctx) + \ - yarnCache(ctx) + \ - [buildOcisBinaryForTesting(ctx)] + \ - cacheCoreReposForTesting(ctx) + \ - testOcisModules(ctx) + \ - testPipelines(ctx) + yarnCache(ctx) + # [buildOcisBinaryForTesting(ctx)] + \ + # cacheCoreReposForTesting(ctx) + \ + # testOcisModules(ctx) + \ + # testPipelines(ctx) build_release_pipelines = \ [licenseCheck(ctx)] + \ @@ -213,26 +213,26 @@ def main(ctx): docs(), ] - test_pipelines.append( - pipelineDependsOn( - purgeBuildArtifactCache(ctx, "ocis-binary-amd64"), - testPipelines(ctx), - ), - ) - test_pipelines.append( - pipelineDependsOn( - purgeBuildArtifactCache(ctx, "testrunner"), - testPipelines(ctx), - ), - ) - test_pipelines.append( - pipelineDependsOn( - purgeBuildArtifactCache(ctx, "testing_app"), - testPipelines(ctx), - ), - ) + # test_pipelines.append( + # pipelineDependsOn( + # purgeBuildArtifactCache(ctx, "ocis-binary-amd64"), + # testPipelines(ctx), + # ), + # ) + # test_pipelines.append( + # pipelineDependsOn( + # purgeBuildArtifactCache(ctx, "testrunner"), + # testPipelines(ctx), + # ), + # ) + # test_pipelines.append( + # pipelineDependsOn( + # purgeBuildArtifactCache(ctx, "testing_app"), + # testPipelines(ctx), + # ), + # ) - pipelines = test_pipelines + build_release_pipelines + build_release_helpers + pipelines = test_pipelines if ctx.build.event == "cron": pipelines = \ @@ -309,6 +309,7 @@ def yarnInstallUITests(): "commands": [ "curl -SsfL -o /usr/local/bin/retry https://raw.githubusercontent.com/owncloud-ci/retry/master/retry && chmod +x /usr/local/bin/retry", ". /drone/src/.drone.env", + "ls", "cd webTestRunner", "git checkout $WEB_COMMITID", "cd tests/acceptance/", From a0ec85dc16571d5c8fa374b83e26ce890071b7e7 Mon Sep 17 00:00:00 2001 From: Swikriti Tripathi Date: Wed, 20 Jul 2022 16:29:27 +0545 Subject: [PATCH 3/4] add depends on --- .drone.star | 1 + 1 file changed, 1 insertion(+) diff --git a/.drone.star b/.drone.star index 8adfd828a8..a50bdf71f2 100644 --- a/.drone.star +++ b/.drone.star @@ -284,6 +284,7 @@ def yarnCache(ctx): restoreBuildArtifactCache(ctx, "web-dist", "webTestRunner") + yarnInstallUITests() + rebuildBuildArtifactCache(ctx, "tests-yarn", "webTestRunner/tests/acceptance/.yarn"), + "depends_on": getPipelineNames(buildCacheWeb(ctx)), "trigger": { "ref": [ "refs/heads/master", From 7b51c16f6eba81b8d4b748c7f22cadc9abb9aa36 Mon Sep 17 00:00:00 2001 From: Swikriti Tripathi Date: Wed, 20 Jul 2022 16:39:02 +0545 Subject: [PATCH 4/4] Allow all the tests --- .drone.star | 51 +++++++++++++++++++++++++-------------------------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/.drone.star b/.drone.star index a50bdf71f2..4c58dcc338 100644 --- a/.drone.star +++ b/.drone.star @@ -134,7 +134,7 @@ config = { "dockerReleases": { "architectures": ["arm", "arm64", "amd64"], }, - "litmus": False, + "litmus": True, } # volume for steps to cache Go dependencies between steps of a pipeline @@ -196,11 +196,11 @@ def main(ctx): test_pipelines = \ cancelPreviousBuilds() + \ buildCacheWeb(ctx) + \ - yarnCache(ctx) - # [buildOcisBinaryForTesting(ctx)] + \ - # cacheCoreReposForTesting(ctx) + \ - # testOcisModules(ctx) + \ - # testPipelines(ctx) + yarnCache(ctx) + \ + [buildOcisBinaryForTesting(ctx)] + \ + cacheCoreReposForTesting(ctx) + \ + testOcisModules(ctx) + \ + testPipelines(ctx) build_release_pipelines = \ [licenseCheck(ctx)] + \ @@ -213,26 +213,26 @@ def main(ctx): docs(), ] - # test_pipelines.append( - # pipelineDependsOn( - # purgeBuildArtifactCache(ctx, "ocis-binary-amd64"), - # testPipelines(ctx), - # ), - # ) - # test_pipelines.append( - # pipelineDependsOn( - # purgeBuildArtifactCache(ctx, "testrunner"), - # testPipelines(ctx), - # ), - # ) - # test_pipelines.append( - # pipelineDependsOn( - # purgeBuildArtifactCache(ctx, "testing_app"), - # testPipelines(ctx), - # ), - # ) + test_pipelines.append( + pipelineDependsOn( + purgeBuildArtifactCache(ctx, "ocis-binary-amd64"), + testPipelines(ctx), + ), + ) + test_pipelines.append( + pipelineDependsOn( + purgeBuildArtifactCache(ctx, "testrunner"), + testPipelines(ctx), + ), + ) + test_pipelines.append( + pipelineDependsOn( + purgeBuildArtifactCache(ctx, "testing_app"), + testPipelines(ctx), + ), + ) - pipelines = test_pipelines + pipelines = test_pipelines + build_release_pipelines + build_release_helpers if ctx.build.event == "cron": pipelines = \ @@ -310,7 +310,6 @@ def yarnInstallUITests(): "commands": [ "curl -SsfL -o /usr/local/bin/retry https://raw.githubusercontent.com/owncloud-ci/retry/master/retry && chmod +x /usr/local/bin/retry", ". /drone/src/.drone.env", - "ls", "cd webTestRunner", "git checkout $WEB_COMMITID", "cd tests/acceptance/",