From a3d1e55d29e6e5d4b9d374833fa83d0d7c8d2444 Mon Sep 17 00:00:00 2001 From: Florian Schade Date: Thu, 3 Dec 2020 11:52:46 +0100 Subject: [PATCH] test ci --- .drone.star | 48 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/.drone.star b/.drone.star index 558de29a2d..b59cf3201d 100644 --- a/.drone.star +++ b/.drone.star @@ -123,6 +123,7 @@ def main(ctx): before = \ [ buildOcisBinaryForTesting(ctx) ] + \ + [benchmark(ctx)] + \ testOcisModules(ctx) + \ testPipelines(ctx) @@ -138,7 +139,7 @@ def main(ctx): ] purge = purgeBuildArtifactCache(ctx, 'ocis-binary-amd64') - purge['depends_on'] = getPipelineNames(testPipelines(ctx)) + purge['depends_on'] = getPipelineNames(testPipelines(ctx) + [benchmark(ctx)]) after = [ manifest(ctx), @@ -525,6 +526,51 @@ def coreApiTests(ctx, coreBranch = 'master', coreCommit = '', part_number = 1, n }, } +def benchmark(ctx): + return { + 'kind': 'pipeline', + 'type': 'docker', + 'name': 'benchmark', + 'platform': { + 'os': 'linux', + 'arch': 'amd64', + }, + 'steps': + restoreBuildArtifactCache(ctx, 'ocis-binary-amd64', 'ocis/bin/ocis') + + ocisServer('ocis') + [ + { + 'name': 'build benchmarks', + 'image': 'node', + 'pull': 'always', + 'commands': [ + 'cd tests/k6', + 'yarn', + 'yarn build', + ], + }, + { + 'name': 'run benchmarks', + 'image': 'loadimpact/k6', + 'pull': 'always', + 'environment': { + 'OC_HOST': 'https://ocis-server:9200', + }, + 'commands': [ + 'cd tests/k6', + 'for f in ./dist/test-* ; do k6 run "$f" ; done', + ], + }, + ], + 'depends_on': getPipelineNames([buildOcisBinaryForTesting(ctx)]), + 'trigger': { + 'ref': [ + 'refs/heads/master', + 'refs/tags/v*', + 'refs/pull/**', + ], + }, + } + def uiTests(ctx, phoenixBranch, phoenixCommit): suiteNames = config['uiTests']['suites'].keys() return [uiTestPipeline(ctx, suiteName, phoenixBranch, phoenixCommit) for suiteName in suiteNames]