[v9.5.x] CI: Move windows-tests into promotion pipeline (#68218) (#68231)

(cherry picked from commit acd02e8a48)

Backport of https://github.com/grafana/grafana/pull/68218
This commit is contained in:
Horst Gutmann
2023-05-10 14:59:50 +00:00
committed by GitHub
parent 3504573574
commit f1d95b2157
7 changed files with 84 additions and 425 deletions
+8
View File
@@ -31,6 +31,10 @@ load(
)
load("scripts/drone/pipelines/github.star", "publish_github_pipeline")
load("scripts/drone/pipelines/aws_marketplace.star", "publish_aws_marketplace_pipeline")
load(
"scripts/drone/pipelines/windows.star",
"windows_test_backend",
)
load("scripts/drone/version.star", "version_branch_pipelines")
load("scripts/drone/events/cron.star", "cronjobs")
load("scripts/drone/vault.star", "secrets")
@@ -51,6 +55,10 @@ def main(_ctx):
publish_artifacts_pipelines("public") +
publish_npm_pipelines() +
publish_packages_pipeline() +
[windows_test_backend({
"event": ["promote"],
"target": ["test-windows"],
}, "oss", "testing")] +
artifacts_page_pipeline() +
version_branch_pipelines() +
integration_test_pipelines() +
+53 -401
View File
@@ -371,56 +371,6 @@ environment:
image_pull_secrets:
- dockerconfigjson
kind: pipeline
name: pr-oss-test-backend-windows
platform:
arch: amd64
os: windows
version: "1809"
services: []
steps:
- commands: []
image: grafana/grafana-ci-windows-test:0.1.0
name: windows-init
- commands:
- go install github.com/google/wire/cmd/wire@v0.5.0
- wire gen -tags oss ./pkg/server
depends_on:
- windows-init
image: grafana/grafana-ci-windows-test:0.1.0
name: wire-install
- commands:
- go test -tags requires_buildifer -short -covermode=atomic -timeout=5m ./pkg/...
depends_on:
- wire-install
failure: ignore
image: grafana/grafana-ci-windows-test:0.1.0
name: test-backend
trigger:
event:
- pull_request
paths:
exclude:
- docs/**
- '*.md'
- pkg/**
- packaging/**
- go.sum
- go.mod
include: []
type: docker
volumes:
- host:
path: //./pipe/docker_engine/
name: docker
---
clone:
retries: 3
depends_on: []
environment:
EDITION: oss
image_pull_secrets:
- dockerconfigjson
kind: pipeline
name: pr-lint-backend
node:
type: no-parallel
@@ -2013,126 +1963,6 @@ volumes:
clone:
retries: 3
depends_on: []
environment:
EDITION: oss
image_pull_secrets:
- dockerconfigjson
kind: pipeline
name: main-oss-test-backend-windows
platform:
arch: amd64
os: windows
version: "1809"
services: []
steps:
- commands: []
image: grafana/grafana-ci-windows-test:0.1.0
name: windows-init
- commands:
- go install github.com/google/wire/cmd/wire@v0.5.0
- wire gen -tags oss ./pkg/server
depends_on:
- windows-init
image: grafana/grafana-ci-windows-test:0.1.0
name: wire-install
- commands:
- go test -tags requires_buildifer -short -covermode=atomic -timeout=5m ./pkg/...
depends_on:
- wire-install
failure: ignore
image: grafana/grafana-ci-windows-test:0.1.0
name: test-backend
trigger:
branch: main
event:
- push
paths:
exclude:
- '*.md'
- docs/**
- latest.json
type: docker
volumes:
- host:
path: //./pipe/docker_engine/
name: docker
---
clone:
disable: true
depends_on: []
environment:
EDITION: enterprise
image_pull_secrets:
- dockerconfigjson
kind: pipeline
name: main-enterprise-test-backend-windows
platform:
arch: amd64
os: windows
version: "1809"
services: []
steps:
- commands:
- $$ProgressPreference = "SilentlyContinue"
- Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.30/windows/grabpl.exe
-OutFile grabpl.exe
image: grafana/ci-wix:0.1.1
name: grabpl
- commands:
- git clone "https://$$env:GITHUB_TOKEN@github.com/grafana/grafana-enterprise.git"
- cd grafana-enterprise
- git checkout main
environment:
GITHUB_TOKEN:
from_secret: github_token
image: grafana/ci-wix:0.1.1
name: clone
- commands:
- cp -r grafana-enterprise C:\App\grafana-enterprise
- rm -r -force grafana-enterprise
- cp grabpl.exe C:\App\grabpl.exe
- rm -force grabpl.exe
- C:\App\grabpl.exe init-enterprise --github-token $$env:GITHUB_TOKEN C:\App\grafana-enterprise
- cp C:\App\grabpl.exe grabpl.exe
depends_on:
- clone
environment:
GITHUB_TOKEN:
from_secret: github_token
image: grafana/ci-wix:0.1.1
name: windows-init
- commands:
- go install github.com/google/wire/cmd/wire@v0.5.0
- wire gen -tags enterprise ./pkg/server
depends_on:
- windows-init
image: grafana/grafana-ci-windows-test:0.1.0
name: wire-install
- commands:
- go test -tags requires_buildifer -short -covermode=atomic -timeout=5m ./pkg/...
depends_on:
- wire-install
failure: ignore
image: grafana/grafana-ci-windows-test:0.1.0
name: test-backend
trigger:
branch: main
event:
- push
paths:
exclude:
- '*.md'
- docs/**
- latest.json
type: docker
volumes:
- host:
path: //./pipe/docker_engine/
name: docker
---
clone:
retries: 3
depends_on: []
kind: pipeline
name: notify-drone-changes
platform:
@@ -2683,132 +2513,11 @@ volumes:
path: /var/run/docker.sock
name: docker
---
clone:
retries: 3
depends_on: []
environment:
EDITION: oss
image_pull_secrets:
- dockerconfigjson
kind: pipeline
name: release-oss-test-backend-windows
platform:
arch: amd64
os: windows
version: "1809"
services: []
steps:
- commands: []
image: grafana/grafana-ci-windows-test:0.1.0
name: windows-init
- commands:
- go install github.com/google/wire/cmd/wire@v0.5.0
- wire gen -tags oss ./pkg/server
depends_on:
- windows-init
image: grafana/grafana-ci-windows-test:0.1.0
name: wire-install
- commands:
- go test -tags requires_buildifer -short -covermode=atomic -timeout=5m ./pkg/...
depends_on:
- wire-install
failure: ignore
image: grafana/grafana-ci-windows-test:0.1.0
name: test-backend
trigger:
event:
exclude:
- promote
ref:
exclude:
- refs/tags/*-cloud*
include:
- refs/tags/v*
type: docker
volumes:
- host:
path: //./pipe/docker_engine/
name: docker
---
clone:
disable: true
depends_on: []
environment:
EDITION: enterprise
image_pull_secrets:
- dockerconfigjson
kind: pipeline
name: release-enterprise-test-backend-windows
platform:
arch: amd64
os: windows
version: "1809"
services: []
steps:
- commands:
- $$ProgressPreference = "SilentlyContinue"
- Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.30/windows/grabpl.exe
-OutFile grabpl.exe
image: grafana/ci-wix:0.1.1
name: grabpl
- commands:
- git clone "https://$$env:GITHUB_TOKEN@github.com/grafana/grafana-enterprise.git"
- cd grafana-enterprise
- git checkout ${DRONE_TAG}
environment:
GITHUB_TOKEN:
from_secret: github_token
image: grafana/ci-wix:0.1.1
name: clone
- commands:
- cp -r grafana-enterprise C:\App\grafana-enterprise
- rm -r -force grafana-enterprise
- cp grabpl.exe C:\App\grabpl.exe
- rm -force grabpl.exe
- C:\App\grabpl.exe init-enterprise --github-token $$env:GITHUB_TOKEN C:\App\grafana-enterprise
- cp C:\App\grabpl.exe grabpl.exe
depends_on:
- clone
environment:
GITHUB_TOKEN:
from_secret: github_token
image: grafana/ci-wix:0.1.1
name: windows-init
- commands:
- go install github.com/google/wire/cmd/wire@v0.5.0
- wire gen -tags enterprise ./pkg/server
depends_on:
- windows-init
image: grafana/grafana-ci-windows-test:0.1.0
name: wire-install
- commands:
- go test -tags requires_buildifer -short -covermode=atomic -timeout=5m ./pkg/...
depends_on:
- wire-install
failure: ignore
image: grafana/grafana-ci-windows-test:0.1.0
name: test-backend
trigger:
event:
exclude:
- promote
ref:
exclude:
- refs/tags/*-cloud*
include:
- refs/tags/v*
type: docker
volumes:
- host:
path: //./pipe/docker_engine/
name: docker
---
clone:
retries: 3
depends_on:
- release-oss-build-e2e-publish
- release-oss-test-frontend
- release-oss-test-backend-windows
environment:
EDITION: oss
image_pull_secrets:
@@ -4520,6 +4229,58 @@ volumes:
clone:
disable: true
depends_on: []
environment:
EDITION: oss
image_pull_secrets:
- dockerconfigjson
kind: pipeline
name: testing-oss-test-backend-windows
platform:
arch: amd64
os: windows
version: "1809"
services: []
steps:
- commands:
- git clone "https://$$env:GITHUB_TOKEN@github.com/$$env:DRONE_REPO.git" .
- git checkout -f $$env:DRONE_COMMIT
environment:
GITHUB_TOKEN:
from_secret: github_token
image: grafana/ci-wix:0.1.1
name: clone
- commands: []
depends_on:
- clone
image: grafana/grafana-ci-windows-test:0.1.0
name: windows-init
- commands:
- go install github.com/google/wire/cmd/wire@v0.5.0
- wire gen -tags oss ./pkg/server
depends_on:
- windows-init
image: grafana/grafana-ci-windows-test:0.1.0
name: wire-install
- commands:
- go test -tags requires_buildifer -short -covermode=atomic -timeout=5m ./pkg/...
depends_on:
- wire-install
image: grafana/grafana-ci-windows-test:0.1.0
name: test-backend
trigger:
event:
- promote
target:
- test-windows
type: docker
volumes:
- host:
path: //./pipe/docker_engine/
name: docker
---
clone:
disable: true
depends_on: []
environment:
EDITION: enterprise
image_pull_secrets:
@@ -5004,114 +4765,6 @@ environment:
image_pull_secrets:
- dockerconfigjson
kind: pipeline
name: release-branch-oss-test-backend-windows
platform:
arch: amd64
os: windows
version: "1809"
services: []
steps:
- commands: []
image: grafana/grafana-ci-windows-test:0.1.0
name: windows-init
- commands:
- go install github.com/google/wire/cmd/wire@v0.5.0
- wire gen -tags oss ./pkg/server
depends_on:
- windows-init
image: grafana/grafana-ci-windows-test:0.1.0
name: wire-install
- commands:
- go test -tags requires_buildifer -short -covermode=atomic -timeout=5m ./pkg/...
depends_on:
- wire-install
failure: ignore
image: grafana/grafana-ci-windows-test:0.1.0
name: test-backend
trigger:
ref:
- refs/heads/v[0-9]*
type: docker
volumes:
- host:
path: //./pipe/docker_engine/
name: docker
---
clone:
disable: true
depends_on: []
environment:
EDITION: enterprise
image_pull_secrets:
- dockerconfigjson
kind: pipeline
name: release-branch-enterprise-test-backend-windows
platform:
arch: amd64
os: windows
version: "1809"
services: []
steps:
- commands:
- $$ProgressPreference = "SilentlyContinue"
- Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.30/windows/grabpl.exe
-OutFile grabpl.exe
image: grafana/ci-wix:0.1.1
name: grabpl
- commands:
- git clone "https://$$env:GITHUB_TOKEN@github.com/grafana/grafana-enterprise.git"
- cd grafana-enterprise
- git checkout $$env:DRONE_BRANCH
environment:
GITHUB_TOKEN:
from_secret: github_token
image: grafana/ci-wix:0.1.1
name: clone
- commands:
- cp -r grafana-enterprise C:\App\grafana-enterprise
- rm -r -force grafana-enterprise
- cp grabpl.exe C:\App\grabpl.exe
- rm -force grabpl.exe
- C:\App\grabpl.exe init-enterprise --github-token $$env:GITHUB_TOKEN C:\App\grafana-enterprise
- cp C:\App\grabpl.exe grabpl.exe
depends_on:
- clone
environment:
GITHUB_TOKEN:
from_secret: github_token
image: grafana/ci-wix:0.1.1
name: windows-init
- commands:
- go install github.com/google/wire/cmd/wire@v0.5.0
- wire gen -tags enterprise ./pkg/server
depends_on:
- windows-init
image: grafana/grafana-ci-windows-test:0.1.0
name: wire-install
- commands:
- go test -tags requires_buildifer -short -covermode=atomic -timeout=5m ./pkg/...
depends_on:
- wire-install
failure: ignore
image: grafana/grafana-ci-windows-test:0.1.0
name: test-backend
trigger:
ref:
- refs/heads/v[0-9]*
type: docker
volumes:
- host:
path: //./pipe/docker_engine/
name: docker
---
clone:
retries: 3
depends_on: []
environment:
EDITION: oss
image_pull_secrets:
- dockerconfigjson
kind: pipeline
name: release-branch-oss-integration-tests
node:
type: no-parallel
@@ -5225,7 +4878,6 @@ clone:
depends_on:
- release-branch-oss-build-e2e-publish
- release-branch-oss-test-frontend
- release-branch-oss-test-backend-windows
environment:
EDITION: oss
image_pull_secrets:
@@ -6884,6 +6536,6 @@ kind: secret
name: enterprise2_security_prefix
---
kind: signature
hmac: 92ba37138be6ae5f5e43cefb99c78a92e6bf05fd43a28825b5ad38e18d5a449d
hmac: 09ac8c69812183afef95e0cfbd00591855498f9427d0153bc49df2a35284784f
...
-3
View File
@@ -32,7 +32,6 @@ load(
load(
"scripts/drone/pipelines/windows.star",
"windows",
"windows_test_backend",
)
load(
"scripts/drone/pipelines/trigger_downstream.star",
@@ -90,8 +89,6 @@ def main_pipelines():
build_e2e(trigger, ver_mode),
integration_tests(trigger, prefix = ver_mode, ver_mode = ver_mode),
windows(trigger, edition = "oss", ver_mode = ver_mode),
windows_test_backend(trigger, "oss", ver_mode),
windows_test_backend(trigger, "enterprise", ver_mode),
notify_pipeline(
name = "notify-drone-changes",
slack_channel = "slack-webhooks-test",
-11
View File
@@ -15,10 +15,6 @@ load(
"scripts/drone/pipelines/integration_tests.star",
"integration_tests",
)
load(
"scripts/drone/pipelines/windows.star",
"windows_test_backend",
)
load(
"scripts/drone/pipelines/build.star",
"build_e2e",
@@ -104,13 +100,6 @@ def pr_pipelines():
),
ver_mode,
),
windows_test_backend(
get_pr_trigger(
exclude_paths = ["pkg/**", "packaging/**", "go.sum", "go.mod"],
),
"oss",
ver_mode,
),
lint_backend_pipeline(
get_pr_trigger(
include_paths = [
-7
View File
@@ -61,10 +61,6 @@ load(
"test_backend",
"test_backend_enterprise",
)
load(
"scripts/drone/pipelines/windows.star",
"windows_test_backend",
)
load("scripts/drone/vault.star", "from_secret", "prerelease_bucket")
ver_mode = "release"
@@ -224,7 +220,6 @@ def oss_pipelines(ver_mode = ver_mode, trigger = release_trigger):
depends_on = [
"{}-oss-build-e2e-publish".format(ver_mode),
"{}-oss-test-frontend".format(ver_mode),
"{}-oss-test-backend-windows".format(ver_mode),
],
environment = environment,
)
@@ -241,8 +236,6 @@ def oss_pipelines(ver_mode = ver_mode, trigger = release_trigger):
),
test_frontend(trigger, ver_mode),
test_backend(trigger, ver_mode),
windows_test_backend(trigger, "oss", ver_mode),
windows_test_backend(trigger, "enterprise", ver_mode),
]
if ver_mode not in ("release"):
+10 -2
View File
@@ -9,6 +9,7 @@ load(
load(
"scripts/drone/steps/lib.star",
"get_windows_steps",
"windows_clone_step",
"windows_go_image",
"windows_init_enterprise_steps",
"windows_test_backend_step",
@@ -26,7 +27,9 @@ def windows_test_backend(trigger, edition, ver_mode):
A single pipeline running backend tests for Windows
"""
environment = {"EDITION": edition}
steps = []
steps = [
windows_clone_step(),
]
if edition == "enterprise":
steps.extend(windows_init_enterprise_steps(ver_mode))
@@ -34,6 +37,7 @@ def windows_test_backend(trigger, edition, ver_mode):
steps.extend([{
"name": "windows-init",
"image": windows_go_image,
"depends_on": ["clone"],
"commands": [],
}])
@@ -41,7 +45,7 @@ def windows_test_backend(trigger, edition, ver_mode):
windows_wire_install_step(edition),
windows_test_backend_step(),
])
return pipeline(
pl = pipeline(
name = "{}-{}-test-backend-windows".format(ver_mode, edition),
edition = edition,
trigger = trigger,
@@ -50,6 +54,10 @@ def windows_test_backend(trigger, edition, ver_mode):
platform = "windows",
environment = environment,
)
pl["clone"] = {
"disable": True,
}
return pl
def windows(trigger, edition, ver_mode):
"""Generates the pipeline used for building Grafana on Windows.
+13 -1
View File
@@ -686,7 +686,6 @@ def test_backend_step(image = build_image):
def windows_test_backend_step():
step = test_backend_step(image = windows_go_image)
step["failure"] = "ignore"
return step
def test_backend_integration_step():
@@ -1361,6 +1360,19 @@ def publish_linux_packages_step(edition, package_manager = "deb"):
},
}
def windows_clone_step():
return {
"name": "clone",
"image": wix_image,
"environment": {
"GITHUB_TOKEN": from_secret("github_token"),
},
"commands": [
'git clone "https://$$env:GITHUB_TOKEN@github.com/$$env:DRONE_REPO.git" .',
"git checkout -f $$env:DRONE_COMMIT",
],
}
def get_windows_steps(edition, ver_mode):
"""Generate the list of Windows steps.