From 9e1e5f8ed5aa6047d4d0d0b5cc527d9a5dd681f5 Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Mon, 7 Oct 2019 12:52:02 +0100 Subject: First attempt at running SyTest in buildkite --- .buildkite/merge_base_branch.sh | 35 +++++++++++++++++++++++++++++++++++ .buildkite/pipeline.yml | 25 +++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100755 .buildkite/merge_base_branch.sh diff --git a/.buildkite/merge_base_branch.sh b/.buildkite/merge_base_branch.sh new file mode 100755 index 0000000000..3a6476a96c --- /dev/null +++ b/.buildkite/merge_base_branch.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +set -e + +# CircleCI doesn't give CIRCLE_PR_NUMBER in the environment for non-forked PRs. Wonderful. +# In this case, we just need to do some ~shell magic~ to strip it out of the PULL_REQUEST URL. +echo 'export CIRCLE_PR_NUMBER="${CIRCLE_PR_NUMBER:-${CIRCLE_PULL_REQUEST##*/}}"' >> $BASH_ENV +source $BASH_ENV + +if [[ -z "${CIRCLE_PR_NUMBER}" ]] +then + echo "Can't figure out what the PR number is! Assuming merge target is dinsic." + + # It probably hasn't had a PR opened yet. Since all PRs for dinsic land on + # dinsic, we can probably assume it's based on it and will be merged into + # it. + GITBASE="dinsic" +else + # Get the reference, using the GitHub API + GITBASE=`wget -O- https://api.github.com/repos/matrix-org/synapse-dinsic/pulls/${CIRCLE_PR_NUMBER} | jq -r '.base.ref'` +fi + +# Show what we are before +git --no-pager show -s + +# Set up username so it can do a merge +git config --global user.email bot@matrix.org +git config --global user.name "A robot" + +# Fetch and merge. If it doesn't work, it will raise due to set -e. +git fetch -u origin $GITBASE +git merge --no-edit origin/$GITBASE + +# Show what we are after. +git --no-pager show -s diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 719f22b4e1..e875fa61dc 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -232,3 +232,28 @@ steps: limit: 2 - exit_status: 2 limit: 2 + + - label: "SyTest - :python: 2.7 / :postgres: 9.6 / Monolith" + agents: + queue: "medium" + env: + POSTGRES: "1" + command: + - "bash .buildkite/merge_base_branch.sh" + - "bash /synapse_sytest.sh" + plugins: + - docker#v3.0.1: + image: "matrixdotorg/sytest-synapse:dinsic" + propagate-environment: true + always-pull: true + workdir: "/src" + entrypoint: "/bin/sh" + init: false + shell: ["-x", "-c"] + mount-buildkite-agent: false + volumes: ["./logs:/logs"] + - artifacts#v1.2.0: + upload: [ "logs/**/*.log", "logs/**/*.log.*", "logs/results.tap" ] + - matrix-org/annotate: + path: "logs/annotate.md" + style: "error" \ No newline at end of file -- cgit 1.5.1 From 90f1eb3ee5bead0bece960fec815edb37b83e22b Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Mon, 7 Oct 2019 12:54:20 +0100 Subject: Changelog --- changelog.d/9.misc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/9.misc diff --git a/changelog.d/9.misc b/changelog.d/9.misc new file mode 100644 index 0000000000..24fd12c978 --- /dev/null +++ b/changelog.d/9.misc @@ -0,0 +1 @@ +Add SyTest to the BuildKite CI. -- cgit 1.5.1 From f38ad87384f45af3db0c6dbf071aef30a16bc81e Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Mon, 7 Oct 2019 13:03:08 +0100 Subject: Use mainline's merge_base_branch.sh --- .buildkite/merge_base_branch.sh | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/.buildkite/merge_base_branch.sh b/.buildkite/merge_base_branch.sh index 3a6476a96c..2dc18c9cf6 100755 --- a/.buildkite/merge_base_branch.sh +++ b/.buildkite/merge_base_branch.sh @@ -1,15 +1,14 @@ #!/usr/bin/env bash -set -e +set -ex -# CircleCI doesn't give CIRCLE_PR_NUMBER in the environment for non-forked PRs. Wonderful. -# In this case, we just need to do some ~shell magic~ to strip it out of the PULL_REQUEST URL. -echo 'export CIRCLE_PR_NUMBER="${CIRCLE_PR_NUMBER:-${CIRCLE_PULL_REQUEST##*/}}"' >> $BASH_ENV -source $BASH_ENV +if [[ "$BUILDKITE_BRANCH" == "dinsic" ]]; then + echo "Not merging forward, as this is a release branch" + exit 0 +fi -if [[ -z "${CIRCLE_PR_NUMBER}" ]] -then - echo "Can't figure out what the PR number is! Assuming merge target is dinsic." +if [[ -z $BUILDKITE_PULL_REQUEST_BASE_BRANCH ]]; then + echo "Can't figure out what the PR number is! Assuming merge target is dinsic." # It probably hasn't had a PR opened yet. Since all PRs for dinsic land on # dinsic, we can probably assume it's based on it and will be merged into @@ -17,7 +16,7 @@ then GITBASE="dinsic" else # Get the reference, using the GitHub API - GITBASE=`wget -O- https://api.github.com/repos/matrix-org/synapse-dinsic/pulls/${CIRCLE_PR_NUMBER} | jq -r '.base.ref'` + GITBASE=$BUILDKITE_PULL_REQUEST_BASE_BRANCH fi # Show what we are before @@ -29,7 +28,7 @@ git config --global user.name "A robot" # Fetch and merge. If it doesn't work, it will raise due to set -e. git fetch -u origin $GITBASE -git merge --no-edit origin/$GITBASE +git merge --no-edit --no-commit origin/$GITBASE # Show what we are after. -git --no-pager show -s +git --no-pager show -s \ No newline at end of file -- cgit 1.5.1 From c5eb8342b278d0a0268547c1e3a4f8c942321278 Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Mon, 7 Oct 2019 15:34:35 +0100 Subject: Try adding workers to CircleCI instead --- .circleci/config.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 341395765d..ba316f7233 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,12 +13,30 @@ jobs: destination: logs - store_test_results: path: /logs + sytestpy2postgresworkersmerged: + docker: + - image: matrixdotorg/sytest-synapse:dinsic + working_directory: /src + steps: + - checkout + - run: bash .circleci/merge_base_branch.sh + - run: POSTGRES=1 WORKERS=1 /synapse_sytest.sh + - store_artifacts: + path: /logs + destination: logs + - store_test_results: + path: /logs + workflows: version: 2 build: jobs: - sytestpy2postgresmerged: + filters: + branches: + ignore: /develop|master|release-.*/ + - sytestpy2postgresworkersmerged: filters: branches: ignore: /develop|master|release-.*/ \ No newline at end of file -- cgit 1.5.1 From 078c0638e3fc75f36cdb77e5d1f5cdcc6cfff971 Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Tue, 8 Oct 2019 16:33:17 +0100 Subject: peek --- .buildkite/pipeline.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index e875fa61dc..2df0a07b39 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -240,6 +240,7 @@ steps: POSTGRES: "1" command: - "bash .buildkite/merge_base_branch.sh" + - "ls" - "bash /synapse_sytest.sh" plugins: - docker#v3.0.1: -- cgit 1.5.1 From 9ec8072a87b54f6e45d5db42c6ea96dbfff7f306 Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Tue, 8 Oct 2019 16:35:08 +0100 Subject: Temporarily move the sytest job before the wait --- .buildkite/pipeline.yml | 53 +++++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 2df0a07b39..d3e8a90297 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -44,6 +44,33 @@ steps: - docker#v3.0.1: image: "python:3.6" + + - label: "SyTest - :python: 2.7 / :postgres: 9.6 / Monolith" + agents: + queue: "medium" + env: + POSTGRES: "1" + command: + - "bash .buildkite/merge_base_branch.sh" + - "ls" + - "bash /synapse_sytest.sh" + plugins: + - docker#v3.0.1: + image: "matrixdotorg/sytest-synapse:dinsic" + propagate-environment: true + always-pull: true + workdir: "/src" + entrypoint: "/bin/sh" + init: false + shell: ["-x", "-c"] + mount-buildkite-agent: false + volumes: ["./logs:/logs"] + - artifacts#v1.2.0: + upload: [ "logs/**/*.log", "logs/**/*.log.*", "logs/results.tap" ] + - matrix-org/annotate: + path: "logs/annotate.md" + style: "error" + - wait - command: @@ -232,29 +259,3 @@ steps: limit: 2 - exit_status: 2 limit: 2 - - - label: "SyTest - :python: 2.7 / :postgres: 9.6 / Monolith" - agents: - queue: "medium" - env: - POSTGRES: "1" - command: - - "bash .buildkite/merge_base_branch.sh" - - "ls" - - "bash /synapse_sytest.sh" - plugins: - - docker#v3.0.1: - image: "matrixdotorg/sytest-synapse:dinsic" - propagate-environment: true - always-pull: true - workdir: "/src" - entrypoint: "/bin/sh" - init: false - shell: ["-x", "-c"] - mount-buildkite-agent: false - volumes: ["./logs:/logs"] - - artifacts#v1.2.0: - upload: [ "logs/**/*.log", "logs/**/*.log.*", "logs/results.tap" ] - - matrix-org/annotate: - path: "logs/annotate.md" - style: "error" \ No newline at end of file -- cgit 1.5.1 From a093ac6d86d08eec874c45bf4f504950c233bc02 Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Tue, 8 Oct 2019 16:40:15 +0100 Subject: peek --- .buildkite/pipeline.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index d3e8a90297..3b95ab1053 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -52,7 +52,9 @@ steps: POSTGRES: "1" command: - "bash .buildkite/merge_base_branch.sh" + - "pwd" - "ls" + - "ls /" - "bash /synapse_sytest.sh" plugins: - docker#v3.0.1: -- cgit 1.5.1 From 41505087597c953d56e86d5b3ccf22693e02a3de Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Tue, 8 Oct 2019 16:45:04 +0100 Subject: peek --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index ba316f7233..162407e539 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,6 +7,8 @@ jobs: steps: - checkout - run: bash .circleci/merge_base_branch.sh + - run: pwd + - run: ls - run: POSTGRES=1 /synapse_sytest.sh - store_artifacts: path: /logs -- cgit 1.5.1 From 6bf5dbc5f23032021e948e71c8595979c6459d5f Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Tue, 8 Oct 2019 16:47:18 +0100 Subject: peek --- .buildkite/pipeline.yml | 1 + .circleci/config.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 3b95ab1053..1650eb42bb 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -55,6 +55,7 @@ steps: - "pwd" - "ls" - "ls /" + - "ls jenkins" - "bash /synapse_sytest.sh" plugins: - docker#v3.0.1: diff --git a/.circleci/config.yml b/.circleci/config.yml index 162407e539..82a2fc6d80 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,6 +9,7 @@ jobs: - run: bash .circleci/merge_base_branch.sh - run: pwd - run: ls + - run: ls jenkins - run: POSTGRES=1 /synapse_sytest.sh - store_artifacts: path: /logs -- cgit 1.5.1 From 60b458540394e90401629eac11ff6575b24e01fb Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Tue, 8 Oct 2019 16:51:18 +0100 Subject: peek --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 82a2fc6d80..027b82e1cf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,6 +9,7 @@ jobs: - run: bash .circleci/merge_base_branch.sh - run: pwd - run: ls + - run: ls / - run: ls jenkins - run: POSTGRES=1 /synapse_sytest.sh - store_artifacts: -- cgit 1.5.1 From b77d92514e5bc71aa9c51908435ecc2e48051983 Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Tue, 8 Oct 2019 17:07:58 +0100 Subject: peek --- .buildkite/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 1650eb42bb..2fb3682a91 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -53,7 +53,7 @@ steps: command: - "bash .buildkite/merge_base_branch.sh" - "pwd" - - "ls" + - "ls -a" - "ls /" - "ls jenkins" - "bash /synapse_sytest.sh" -- cgit 1.5.1 From 4d52ccf41f37a52f7cb7d84c6999a1e33558da72 Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Tue, 8 Oct 2019 17:09:14 +0100 Subject: peek --- .buildkite/pipeline.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 2fb3682a91..72678e82c8 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -53,6 +53,7 @@ steps: command: - "bash .buildkite/merge_base_branch.sh" - "pwd" + - "git --git-dir=/src/.git symbolic-ref HEAD" - "ls -a" - "ls /" - "ls jenkins" -- cgit 1.5.1 From 9398f55982d7acf3d3267084f791465a10f5dd51 Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Tue, 8 Oct 2019 17:37:29 +0100 Subject: Try to fix CircleCI --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 027b82e1cf..6d56ca703c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -19,7 +19,7 @@ jobs: path: /logs sytestpy2postgresworkersmerged: docker: - - image: matrixdotorg/sytest-synapse:dinsic + - image: matrixdotorg/sytest-synapse:dinsic-test working_directory: /src steps: - checkout -- cgit 1.5.1 From 7123f50c44bd8adf169aa2cadfd64c8a3b9bd504 Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Tue, 8 Oct 2019 18:15:47 +0100 Subject: fix --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6d56ca703c..027b82e1cf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -19,7 +19,7 @@ jobs: path: /logs sytestpy2postgresworkersmerged: docker: - - image: matrixdotorg/sytest-synapse:dinsic-test + - image: matrixdotorg/sytest-synapse:dinsic working_directory: /src steps: - checkout -- cgit 1.5.1 From c29182ce8ac162e5b3584c6174a5b9915bd1ace1 Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Wed, 9 Oct 2019 11:06:29 +0100 Subject: Add python3 jobs --- .circleci/config.yml | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 027b82e1cf..86f9fa9372 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,10 +7,6 @@ jobs: steps: - checkout - run: bash .circleci/merge_base_branch.sh - - run: pwd - - run: ls - - run: ls / - - run: ls jenkins - run: POSTGRES=1 /synapse_sytest.sh - store_artifacts: path: /logs @@ -30,6 +26,32 @@ jobs: destination: logs - store_test_results: path: /logs + sytestpy3postgresmerged: + docker: + - image: matrixdotorg/sytest-synapse:dinsic + working_directory: /src + steps: + - checkout + - run: bash .circleci/merge_base_branch.sh + - run: POSTGRES=1 /synapse_sytest.sh + - store_artifacts: + path: /logs + destination: logs + - store_test_results: + path: /logs + sytestpy3postgresworkersmerged: + docker: + - image: matrixdotorg/sytest-synapse:dinsic + working_directory: /src + steps: + - checkout + - run: bash .circleci/merge_base_branch.sh + - run: POSTGRES=1 WORKERS=1 /synapse_sytest.sh + - store_artifacts: + path: /logs + destination: logs + - store_test_results: + path: /logs workflows: @@ -41,6 +63,14 @@ workflows: branches: ignore: /develop|master|release-.*/ - sytestpy2postgresworkersmerged: + filters: + branches: + ignore: /develop|master|release-.*/ + - sytestpy3postgresmerged: + filters: + branches: + ignore: /develop|master|release-.*/ + - sytestpy3postgresworkersmerged: filters: branches: ignore: /develop|master|release-.*/ \ No newline at end of file -- cgit 1.5.1 From d6371916cc999a964867f1fc80d3d0d5e8b2d6f0 Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Wed, 9 Oct 2019 11:08:30 +0100 Subject: Actually use the right image --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 86f9fa9372..ad6d839f35 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,7 +28,7 @@ jobs: path: /logs sytestpy3postgresmerged: docker: - - image: matrixdotorg/sytest-synapse:dinsic + - image: matrixdotorg/sytest-synapse:dinsic-py3 working_directory: /src steps: - checkout @@ -41,7 +41,7 @@ jobs: path: /logs sytestpy3postgresworkersmerged: docker: - - image: matrixdotorg/sytest-synapse:dinsic + - image: matrixdotorg/sytest-synapse:dinsic-py3 working_directory: /src steps: - checkout -- cgit 1.5.1 From 1a58f6196f2f601b85daf997c3749aff9eb98e70 Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Wed, 9 Oct 2019 11:17:36 +0100 Subject: Try to run stuff on buildkite --- .buildkite/pipeline.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 72678e82c8..d890e4a9c0 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -52,15 +52,10 @@ steps: POSTGRES: "1" command: - "bash .buildkite/merge_base_branch.sh" - - "pwd" - - "git --git-dir=/src/.git symbolic-ref HEAD" - - "ls -a" - - "ls /" - - "ls jenkins" - "bash /synapse_sytest.sh" plugins: - docker#v3.0.1: - image: "matrixdotorg/sytest-synapse:dinsic" + image: "matrixdotorg/sytest-synapse:dinsic-test" propagate-environment: true always-pull: true workdir: "/src" -- cgit 1.5.1 From 7a50b07bb425cfd65705602dad426697d6d0011e Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Wed, 9 Oct 2019 11:34:20 +0100 Subject: Add workers to buildkite --- .buildkite/pipeline.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index d890e4a9c0..f16682824d 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -44,6 +44,31 @@ steps: - docker#v3.0.1: image: "python:3.6" + - label: "SyTest - :python: 2.7 / :postgres: 9.6 / Workers" + agents: + queue: "medium" + env: + POSTGRES: "1" + WORKERS: "1" + command: + - "bash .buildkite/merge_base_branch.sh" + - "bash /synapse_sytest.sh" + plugins: + - docker#v3.0.1: + image: "matrixdotorg/sytest-synapse:dinsic-test" + propagate-environment: true + always-pull: true + workdir: "/src" + entrypoint: "/bin/sh" + init: false + shell: ["-x", "-c"] + mount-buildkite-agent: false + volumes: ["./logs:/logs"] + - artifacts#v1.2.0: + upload: [ "logs/**/*.log", "logs/**/*.log.*", "logs/results.tap" ] + - matrix-org/annotate: + path: "logs/annotate.md" + style: "error" - label: "SyTest - :python: 2.7 / :postgres: 9.6 / Monolith" agents: -- cgit 1.5.1 From c3c1add9f30102b0c2b2f47abcd64fe705de7c2d Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Fri, 18 Oct 2019 14:52:57 +0100 Subject: Add TAP formatting script --- .buildkite/format_tap.py | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .buildkite/format_tap.py diff --git a/.buildkite/format_tap.py b/.buildkite/format_tap.py new file mode 100644 index 0000000000..f153ffb661 --- /dev/null +++ b/.buildkite/format_tap.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2019 The Matrix.org Foundation C.I.C. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys +from tap.parser import Parser +from tap.line import Result, Unknown, Diagnostic + +out = ["### TAP Output for " + sys.argv[2]] + +p = Parser() + +in_error = False + +for line in p.parse_file(sys.argv[1]): + if isinstance(line, Result): + if in_error: + out.append("") + out.append("") + out.append("") + out.append("----") + out.append("") + in_error = False + + if not line.ok and not line.todo: + in_error = True + + out.append("FAILURE Test #%d: ``%s``" % (line.number, line.description)) + out.append("") + out.append("
Show log
")
+
+    elif isinstance(line, Diagnostic) and in_error:
+        out.append(line.text)
+
+if out:
+    for line in out[:-3]:
+        print(line)
\ No newline at end of file
-- 
cgit 1.5.1


From 73147f44fcbaea6ee1e5869a04196a1da0a26e1d Mon Sep 17 00:00:00 2001
From: Brendan Abolivier 
Date: Fri, 18 Oct 2019 15:25:45 +0100
Subject: Add py3 jobs on BuildKite

---
 .buildkite/pipeline.yml | 55 +++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 53 insertions(+), 2 deletions(-)

diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml
index f16682824d..7bbd2c47fa 100644
--- a/.buildkite/pipeline.yml
+++ b/.buildkite/pipeline.yml
@@ -44,6 +44,31 @@ steps:
       - docker#v3.0.1:
           image: "python:3.6"
 
+  - label: "SyTest - :python: 2.7 / :postgres: 9.6 / Monolith"
+    agents:
+      queue: "medium"
+    env:
+      POSTGRES: "1"
+    command:
+      - "bash .buildkite/merge_base_branch.sh"
+      - "bash /synapse_sytest.sh"
+    plugins:
+      - docker#v3.0.1:
+          image: "matrixdotorg/sytest-synapse:dinsic-test"
+          propagate-environment: true
+          always-pull: true
+          workdir: "/src"
+          entrypoint: "/bin/sh"
+          init: false
+          shell: ["-x", "-c"]
+          mount-buildkite-agent: false
+          volumes: ["./logs:/logs"]
+      - artifacts#v1.2.0:
+          upload: [ "logs/**/*.log", "logs/**/*.log.*", "logs/results.tap" ]
+      - matrix-org/annotate:
+          path: "logs/annotate.md"
+          style: "error"
+
   - label: "SyTest - :python: 2.7 / :postgres: 9.6 / Workers"
     agents:
       queue: "medium"
@@ -70,7 +95,7 @@ steps:
           path: "logs/annotate.md"
           style: "error"
 
-  - label: "SyTest - :python: 2.7 / :postgres: 9.6 / Monolith"
+  - label: "SyTest - :python: 3 / :postgres: 9.6 / Monolith"
     agents:
       queue: "medium"
     env:
@@ -80,7 +105,33 @@ steps:
       - "bash /synapse_sytest.sh"
     plugins:
       - docker#v3.0.1:
-          image: "matrixdotorg/sytest-synapse:dinsic-test"
+          image: "matrixdotorg/sytest-synapse:dinsic-test-py3"
+          propagate-environment: true
+          always-pull: true
+          workdir: "/src"
+          entrypoint: "/bin/sh"
+          init: false
+          shell: ["-x", "-c"]
+          mount-buildkite-agent: false
+          volumes: ["./logs:/logs"]
+      - artifacts#v1.2.0:
+          upload: [ "logs/**/*.log", "logs/**/*.log.*", "logs/results.tap" ]
+      - matrix-org/annotate:
+          path: "logs/annotate.md"
+          style: "error"
+
+  - label: "SyTest - :python: 3 / :postgres: 9.6 / Workers"
+    agents:
+      queue: "medium"
+    env:
+      POSTGRES: "1"
+      WORKERS: "1"
+    command:
+      - "bash .buildkite/merge_base_branch.sh"
+      - "bash /synapse_sytest.sh"
+    plugins:
+      - docker#v3.0.1:
+          image: "matrixdotorg/sytest-synapse:dinsic-test-py3"
           propagate-environment: true
           always-pull: true
           workdir: "/src"
-- 
cgit 1.5.1


From a4e4a9c93b14fcf0d6ee3f31adbc071a7075d169 Mon Sep 17 00:00:00 2001
From: Brendan Abolivier 
Date: Mon, 21 Oct 2019 17:35:16 +0100
Subject: Try running the workers job on bigger agents

---
 .buildkite/pipeline.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml
index 7bbd2c47fa..32fe64092a 100644
--- a/.buildkite/pipeline.yml
+++ b/.buildkite/pipeline.yml
@@ -71,7 +71,7 @@ steps:
 
   - label: "SyTest - :python: 2.7 / :postgres: 9.6 / Workers"
     agents:
-      queue: "medium"
+      queue: "xlarge"
     env:
       POSTGRES: "1"
       WORKERS: "1"
@@ -122,7 +122,7 @@ steps:
 
   - label: "SyTest - :python: 3 / :postgres: 9.6 / Workers"
     agents:
-      queue: "medium"
+      queue: "xlarge"
     env:
       POSTGRES: "1"
       WORKERS: "1"
-- 
cgit 1.5.1


From 0263c044ff34b21d4a9346ed39c5aa07470a1313 Mon Sep 17 00:00:00 2001
From: Brendan Abolivier 
Date: Wed, 23 Oct 2019 17:37:28 +0100
Subject: Move sytest jobs to the right location

---
 .buildkite/pipeline.yml | 205 ++++++++++++++++++++++++------------------------
 1 file changed, 103 insertions(+), 102 deletions(-)

diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml
index 32fe64092a..1f035a6ab1 100644
--- a/.buildkite/pipeline.yml
+++ b/.buildkite/pipeline.yml
@@ -44,108 +44,6 @@ steps:
       - docker#v3.0.1:
           image: "python:3.6"
 
-  - label: "SyTest - :python: 2.7 / :postgres: 9.6 / Monolith"
-    agents:
-      queue: "medium"
-    env:
-      POSTGRES: "1"
-    command:
-      - "bash .buildkite/merge_base_branch.sh"
-      - "bash /synapse_sytest.sh"
-    plugins:
-      - docker#v3.0.1:
-          image: "matrixdotorg/sytest-synapse:dinsic-test"
-          propagate-environment: true
-          always-pull: true
-          workdir: "/src"
-          entrypoint: "/bin/sh"
-          init: false
-          shell: ["-x", "-c"]
-          mount-buildkite-agent: false
-          volumes: ["./logs:/logs"]
-      - artifacts#v1.2.0:
-          upload: [ "logs/**/*.log", "logs/**/*.log.*", "logs/results.tap" ]
-      - matrix-org/annotate:
-          path: "logs/annotate.md"
-          style: "error"
-
-  - label: "SyTest - :python: 2.7 / :postgres: 9.6 / Workers"
-    agents:
-      queue: "xlarge"
-    env:
-      POSTGRES: "1"
-      WORKERS: "1"
-    command:
-      - "bash .buildkite/merge_base_branch.sh"
-      - "bash /synapse_sytest.sh"
-    plugins:
-      - docker#v3.0.1:
-          image: "matrixdotorg/sytest-synapse:dinsic-test"
-          propagate-environment: true
-          always-pull: true
-          workdir: "/src"
-          entrypoint: "/bin/sh"
-          init: false
-          shell: ["-x", "-c"]
-          mount-buildkite-agent: false
-          volumes: ["./logs:/logs"]
-      - artifacts#v1.2.0:
-          upload: [ "logs/**/*.log", "logs/**/*.log.*", "logs/results.tap" ]
-      - matrix-org/annotate:
-          path: "logs/annotate.md"
-          style: "error"
-
-  - label: "SyTest - :python: 3 / :postgres: 9.6 / Monolith"
-    agents:
-      queue: "medium"
-    env:
-      POSTGRES: "1"
-    command:
-      - "bash .buildkite/merge_base_branch.sh"
-      - "bash /synapse_sytest.sh"
-    plugins:
-      - docker#v3.0.1:
-          image: "matrixdotorg/sytest-synapse:dinsic-test-py3"
-          propagate-environment: true
-          always-pull: true
-          workdir: "/src"
-          entrypoint: "/bin/sh"
-          init: false
-          shell: ["-x", "-c"]
-          mount-buildkite-agent: false
-          volumes: ["./logs:/logs"]
-      - artifacts#v1.2.0:
-          upload: [ "logs/**/*.log", "logs/**/*.log.*", "logs/results.tap" ]
-      - matrix-org/annotate:
-          path: "logs/annotate.md"
-          style: "error"
-
-  - label: "SyTest - :python: 3 / :postgres: 9.6 / Workers"
-    agents:
-      queue: "xlarge"
-    env:
-      POSTGRES: "1"
-      WORKERS: "1"
-    command:
-      - "bash .buildkite/merge_base_branch.sh"
-      - "bash /synapse_sytest.sh"
-    plugins:
-      - docker#v3.0.1:
-          image: "matrixdotorg/sytest-synapse:dinsic-test-py3"
-          propagate-environment: true
-          always-pull: true
-          workdir: "/src"
-          entrypoint: "/bin/sh"
-          init: false
-          shell: ["-x", "-c"]
-          mount-buildkite-agent: false
-          volumes: ["./logs:/logs"]
-      - artifacts#v1.2.0:
-          upload: [ "logs/**/*.log", "logs/**/*.log.*", "logs/results.tap" ]
-      - matrix-org/annotate:
-          path: "logs/annotate.md"
-          style: "error"
-
   - wait
 
   - command:
@@ -334,3 +232,106 @@ steps:
           limit: 2
         - exit_status: 2
           limit: 2
+
+  - label: "SyTest - :python: 2.7 / :postgres: 9.6 / Monolith"
+    agents:
+      queue: "medium"
+    env:
+      POSTGRES: "1"
+    command:
+      - "bash .buildkite/merge_base_branch.sh"
+      - "bash /synapse_sytest.sh"
+    plugins:
+      - docker#v3.0.1:
+          image: "matrixdotorg/sytest-synapse:dinsic-test"
+          propagate-environment: true
+          always-pull: true
+          workdir: "/src"
+          entrypoint: "/bin/sh"
+          init: false
+          shell: ["-x", "-c"]
+          mount-buildkite-agent: false
+          volumes: ["./logs:/logs"]
+      - artifacts#v1.2.0:
+          upload: [ "logs/**/*.log", "logs/**/*.log.*", "logs/results.tap" ]
+      - matrix-org/annotate:
+          path: "logs/annotate.md"
+          style: "error"
+
+  - label: "SyTest - :python: 2.7 / :postgres: 9.6 / Workers"
+    agents:
+      queue: "xlarge"
+    env:
+      POSTGRES: "1"
+      WORKERS: "1"
+    command:
+      - "bash .buildkite/merge_base_branch.sh"
+      - "bash /synapse_sytest.sh"
+    plugins:
+      - docker#v3.0.1:
+          image: "matrixdotorg/sytest-synapse:dinsic-test"
+          propagate-environment: true
+          always-pull: true
+          workdir: "/src"
+          entrypoint: "/bin/sh"
+          init: false
+          shell: ["-x", "-c"]
+          mount-buildkite-agent: false
+          volumes: ["./logs:/logs"]
+      - artifacts#v1.2.0:
+          upload: [ "logs/**/*.log", "logs/**/*.log.*", "logs/results.tap" ]
+      - matrix-org/annotate:
+          path: "logs/annotate.md"
+          style: "error"
+
+  - label: "SyTest - :python: 3 / :postgres: 9.6 / Monolith"
+    agents:
+      queue: "medium"
+    env:
+      POSTGRES: "1"
+    command:
+      - "bash .buildkite/merge_base_branch.sh"
+      - "bash /synapse_sytest.sh"
+    plugins:
+      - docker#v3.0.1:
+          image: "matrixdotorg/sytest-synapse:dinsic-py3"
+          propagate-environment: true
+          always-pull: true
+          workdir: "/src"
+          entrypoint: "/bin/sh"
+          init: false
+          shell: ["-x", "-c"]
+          mount-buildkite-agent: false
+          volumes: ["./logs:/logs"]
+      - artifacts#v1.2.0:
+          upload: [ "logs/**/*.log", "logs/**/*.log.*", "logs/results.tap" ]
+      - matrix-org/annotate:
+          path: "logs/annotate.md"
+          style: "error"
+
+  - label: "SyTest - :python: 3 / :postgres: 9.6 / Workers"
+    agents:
+      queue: "xlarge"
+    env:
+      POSTGRES: "1"
+      WORKERS: "1"
+    command:
+      - "bash .buildkite/merge_base_branch.sh"
+      - "bash /synapse_sytest.sh"
+    plugins:
+      - docker#v3.0.1:
+          image: "matrixdotorg/sytest-synapse:dinsic-py3"
+          propagate-environment: true
+          always-pull: true
+          workdir: "/src"
+          entrypoint: "/bin/sh"
+          init: false
+          shell: ["-x", "-c"]
+          mount-buildkite-agent: false
+          volumes: ["./logs:/logs"]
+      - artifacts#v1.2.0:
+          upload: [ "logs/**/*.log", "logs/**/*.log.*", "logs/results.tap" ]
+      - matrix-org/annotate:
+          path: "logs/annotate.md"
+          style: "error"
+
-- 
cgit 1.5.1


From 7467a8090c51ac862d60cb70c79f11be7137492c Mon Sep 17 00:00:00 2001
From: Brendan Abolivier 
Date: Wed, 23 Oct 2019 17:37:50 +0100
Subject: Remove CircleCI configuration

---
 .circleci/config.yml           | 76 ------------------------------------------
 .circleci/merge_base_branch.sh | 35 -------------------
 2 files changed, 111 deletions(-)
 delete mode 100644 .circleci/config.yml
 delete mode 100755 .circleci/merge_base_branch.sh

diff --git a/.circleci/config.yml b/.circleci/config.yml
deleted file mode 100644
index ad6d839f35..0000000000
--- a/.circleci/config.yml
+++ /dev/null
@@ -1,76 +0,0 @@
-version: 2
-jobs:
-  sytestpy2postgresmerged:
-    docker:
-      - image: matrixdotorg/sytest-synapse:dinsic
-    working_directory: /src
-    steps:
-      - checkout
-      - run: bash .circleci/merge_base_branch.sh
-      - run: POSTGRES=1 /synapse_sytest.sh
-      - store_artifacts:
-          path: /logs
-          destination: logs
-      - store_test_results:
-          path: /logs
-  sytestpy2postgresworkersmerged:
-    docker:
-      - image: matrixdotorg/sytest-synapse:dinsic
-    working_directory: /src
-    steps:
-      - checkout
-      - run: bash .circleci/merge_base_branch.sh
-      - run: POSTGRES=1 WORKERS=1 /synapse_sytest.sh
-      - store_artifacts:
-          path: /logs
-          destination: logs
-      - store_test_results:
-          path: /logs
-  sytestpy3postgresmerged:
-      docker:
-        - image: matrixdotorg/sytest-synapse:dinsic-py3
-      working_directory: /src
-      steps:
-        - checkout
-        - run: bash .circleci/merge_base_branch.sh
-        - run: POSTGRES=1 /synapse_sytest.sh
-        - store_artifacts:
-            path: /logs
-            destination: logs
-        - store_test_results:
-            path: /logs
-  sytestpy3postgresworkersmerged:
-      docker:
-        - image: matrixdotorg/sytest-synapse:dinsic-py3
-      working_directory: /src
-      steps:
-        - checkout
-        - run: bash .circleci/merge_base_branch.sh
-        - run: POSTGRES=1 WORKERS=1 /synapse_sytest.sh
-        - store_artifacts:
-            path: /logs
-            destination: logs
-        - store_test_results:
-            path: /logs
-
-
-workflows:
-  version: 2
-  build:
-    jobs:
-      - sytestpy2postgresmerged:
-          filters:
-            branches:
-              ignore: /develop|master|release-.*/
-      - sytestpy2postgresworkersmerged:
-          filters:
-            branches:
-              ignore: /develop|master|release-.*/
-      - sytestpy3postgresmerged:
-          filters:
-            branches:
-              ignore: /develop|master|release-.*/
-      - sytestpy3postgresworkersmerged:
-          filters:
-            branches:
-              ignore: /develop|master|release-.*/
\ No newline at end of file
diff --git a/.circleci/merge_base_branch.sh b/.circleci/merge_base_branch.sh
deleted file mode 100755
index 3a6476a96c..0000000000
--- a/.circleci/merge_base_branch.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-
-# CircleCI doesn't give CIRCLE_PR_NUMBER in the environment for non-forked PRs. Wonderful.
-# In this case, we just need to do some ~shell magic~ to strip it out of the PULL_REQUEST URL.
-echo 'export CIRCLE_PR_NUMBER="${CIRCLE_PR_NUMBER:-${CIRCLE_PULL_REQUEST##*/}}"' >> $BASH_ENV
-source $BASH_ENV
-
-if [[ -z "${CIRCLE_PR_NUMBER}" ]]
-then
-    echo "Can't figure out what the PR number is! Assuming merge target is dinsic."
-
-    # It probably hasn't had a PR opened yet. Since all PRs for dinsic land on
-    # dinsic, we can probably assume it's based on it and will be merged into
-    # it.
-    GITBASE="dinsic"
-else
-    # Get the reference, using the GitHub API
-    GITBASE=`wget -O- https://api.github.com/repos/matrix-org/synapse-dinsic/pulls/${CIRCLE_PR_NUMBER} | jq -r '.base.ref'`
-fi
-
-# Show what we are before
-git --no-pager show -s
-
-# Set up username so it can do a merge
-git config --global user.email bot@matrix.org
-git config --global user.name "A robot"
-
-# Fetch and merge. If it doesn't work, it will raise due to set -e.
-git fetch -u origin $GITBASE
-git merge --no-edit origin/$GITBASE
-
-# Show what we are after.
-git --no-pager show -s
-- 
cgit 1.5.1


From 0559c87007972ef76cf26b9dc7e0a150afac69ce Mon Sep 17 00:00:00 2001
From: Brendan Abolivier 
Date: Thu, 31 Oct 2019 15:49:15 +0000
Subject: Don't use test image

---
 .buildkite/pipeline.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml
index 1f035a6ab1..75d0eb7f32 100644
--- a/.buildkite/pipeline.yml
+++ b/.buildkite/pipeline.yml
@@ -243,7 +243,7 @@ steps:
       - "bash /synapse_sytest.sh"
     plugins:
       - docker#v3.0.1:
-          image: "matrixdotorg/sytest-synapse:dinsic-test"
+          image: "matrixdotorg/sytest-synapse:dinsic"
           propagate-environment: true
           always-pull: true
           workdir: "/src"
@@ -269,7 +269,7 @@ steps:
       - "bash /synapse_sytest.sh"
     plugins:
       - docker#v3.0.1:
-          image: "matrixdotorg/sytest-synapse:dinsic-test"
+          image: "matrixdotorg/sytest-synapse:dinsic"
           propagate-environment: true
           always-pull: true
           workdir: "/src"
-- 
cgit 1.5.1


From e6f0536de17c625d627a5288581ee404400a533a Mon Sep 17 00:00:00 2001
From: Brendan Abolivier 
Date: Thu, 31 Oct 2019 16:16:25 +0000
Subject: Remove python TAP script

---
 .buildkite/format_tap.py | 48 ------------------------------------------------
 1 file changed, 48 deletions(-)
 delete mode 100644 .buildkite/format_tap.py

diff --git a/.buildkite/format_tap.py b/.buildkite/format_tap.py
deleted file mode 100644
index f153ffb661..0000000000
--- a/.buildkite/format_tap.py
+++ /dev/null
@@ -1,48 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright 2019 The Matrix.org Foundation C.I.C.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import sys
-from tap.parser import Parser
-from tap.line import Result, Unknown, Diagnostic
-
-out = ["### TAP Output for " + sys.argv[2]]
-
-p = Parser()
-
-in_error = False
-
-for line in p.parse_file(sys.argv[1]):
-    if isinstance(line, Result):
-        if in_error:
-            out.append("")
-            out.append("
") - out.append("") - out.append("----") - out.append("") - in_error = False - - if not line.ok and not line.todo: - in_error = True - - out.append("FAILURE Test #%d: ``%s``" % (line.number, line.description)) - out.append("") - out.append("
Show log
")
-
-    elif isinstance(line, Diagnostic) and in_error:
-        out.append(line.text)
-
-if out:
-    for line in out[:-3]:
-        print(line)
\ No newline at end of file
-- 
cgit 1.5.1