Remove integration tags for enterprise (#50974)

* Remove integration tags for enterprise

* Adjust integration tests and backend tests for the current enterprise setup

* Remove entrerprise2 integration step and use go command for enterprise2 backend step

* CI: Tidy up `release-enterprise-*` pipeline dependencies (#51031)

* Tidy up enterprise deps

* Fixes according to reviewer's comments

Co-authored-by: dsotirakis <sotirakis.dim@gmail.com>
pull/51251/head
idafurjes 3 years ago committed by GitHub
parent cef81a6478
commit ef23a76310
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 98
      .drone.yml
  2. 6
      scripts/drone/pipelines/main.star
  3. 6
      scripts/drone/pipelines/pr.star
  4. 12
      scripts/drone/pipelines/release.star
  5. 50
      scripts/drone/steps/lib.star
  6. BIN
      scripts/go/bin/revive

@ -100,6 +100,7 @@ steps:
- '# The following command will fail if running code generators produces any diff
in output.'
- CODEGEN_VERIFY=1 make gen-cue
depends_on: []
image: grafana/build-container:1.5.7
name: verify-gen-cue
- commands:
@ -205,6 +206,7 @@ steps:
- '# The following command will fail if running code generators produces any diff
in output.'
- CODEGEN_VERIFY=1 make gen-cue
depends_on: []
image: grafana/build-container:1.5.7
name: verify-gen-cue
- commands:
@ -460,6 +462,7 @@ steps:
- '# The following command will fail if running code generators produces any diff
in output.'
- CODEGEN_VERIFY=1 make gen-cue
depends_on: []
image: grafana/build-container:1.5.7
name: verify-gen-cue
- commands:
@ -788,6 +791,7 @@ steps:
- '# The following command will fail if running code generators produces any diff
in output.'
- CODEGEN_VERIFY=1 make gen-cue
depends_on: []
image: grafana/build-container:1.5.7
name: verify-gen-cue
- commands:
@ -882,6 +886,7 @@ steps:
- '# The following command will fail if running code generators produces any diff
in output.'
- CODEGEN_VERIFY=1 make gen-cue
depends_on: []
image: grafana/build-container:1.5.7
name: verify-gen-cue
- commands:
@ -1303,6 +1308,7 @@ steps:
- '# The following command will fail if running code generators produces any diff
in output.'
- CODEGEN_VERIFY=1 make gen-cue
depends_on: []
image: grafana/build-container:1.5.7
name: verify-gen-cue
- commands:
@ -1567,6 +1573,7 @@ steps:
- '# The following command will fail if running code generators produces any diff
in output.'
- CODEGEN_VERIFY=1 make gen-cue
depends_on: []
image: grafana/build-container:1.5.7
name: verify-gen-cue
- commands:
@ -1864,6 +1871,7 @@ steps:
- '# The following command will fail if running code generators produces any diff
in output.'
- CODEGEN_VERIFY=1 make gen-cue
depends_on: []
image: grafana/build-container:1.5.7
name: verify-gen-cue
- commands:
@ -1996,6 +2004,7 @@ steps:
- '# The following command will fail if running code generators produces any diff
in output.'
- CODEGEN_VERIFY=1 make gen-cue
depends_on: []
image: grafana/build-container:1.5.7
name: verify-gen-cue
- commands:
@ -2575,13 +2584,13 @@ steps:
image: grafana/build-container:1.5.7
name: lint-frontend
- commands:
- ./bin/grabpl test-backend --edition enterprise
- go test -short -covermode=atomic -timeout=30m ./pkg/...
depends_on:
- wire-install
image: grafana/build-container:1.5.7
name: test-backend
- commands:
- ./bin/grabpl integration-tests --edition enterprise
- go test -run Integration -covermode=atomic -timeout=30m ./pkg/...
depends_on:
- wire-install
image: grafana/build-container:1.5.7
@ -2603,17 +2612,11 @@ steps:
image: grafana/build-container:1.5.7
name: lint-backend-enterprise2
- commands:
- ./bin/grabpl test-backend --edition enterprise2
- go test -tags=pro -covermode=atomic -timeout=30m ./pkg/...
depends_on:
- wire-install
image: grafana/build-container:1.5.7
name: test-backend-enterprise2
- commands:
- ./bin/grabpl integration-tests --edition enterprise2
depends_on:
- wire-install
image: grafana/build-container:1.5.7
name: test-backend-integration-enterprise2
trigger:
event:
exclude:
@ -2704,15 +2707,32 @@ steps:
from_secret: github_token
image: grafana/build-container:1.5.7
name: init-enterprise
- commands:
- '# It is required that code generated from Thema/CUE be committed and in sync
with its inputs.'
- '# The following command will fail if running code generators produces any diff
in output.'
- CODEGEN_VERIFY=1 make gen-cue
depends_on:
- init-enterprise
image: grafana/build-container:1.5.7
name: verify-gen-cue
- commands:
- make gen-go
depends_on:
- verify-gen-cue
image: grafana/build-container:1.5.7
name: wire-install
- commands:
- apt-get update
- apt-get install -yq postgresql-client
- dockerize -wait tcp://postgres:5432 -timeout 120s
- psql -p 5432 -h postgres -U grafanatest -d grafanatest -f devenv/docker/blocks/postgres_tests/setup.sql
- go clean -testcache
- ./bin/grabpl integration-tests --database postgres
- go list './pkg/...' | xargs -I {} sh -c 'go test -run Integration -covermode=atomic
-timeout=30m {}'
depends_on:
- init-enterprise
- wire-install
environment:
GRAFANA_TEST_DB: postgres
PGPASSWORD: grafanatest
@ -2726,9 +2746,10 @@ steps:
- cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql -P 3306 -u root
-prootpass
- go clean -testcache
- ./bin/grabpl integration-tests --database mysql
- go list './pkg/...' | xargs -I {} sh -c 'go test -run Integration -covermode=atomic
-timeout=30m {}'
depends_on:
- init-enterprise
- wire-install
environment:
GRAFANA_TEST_DB: mysql
MYSQL_HOST: mysql
@ -2738,7 +2759,7 @@ steps:
- dockerize -wait tcp://redis:6379/0 -timeout 120s
- ./bin/grabpl integration-tests
depends_on:
- init-enterprise
- wire-install
environment:
REDIS_URL: redis://redis:6379/0
image: grafana/build-container:1.5.7
@ -2747,7 +2768,7 @@ steps:
- dockerize -wait tcp://memcached:11211 -timeout 120s
- ./bin/grabpl integration-tests
depends_on:
- init-enterprise
- wire-install
environment:
MEMCACHED_HOSTS: memcached:11211
image: grafana/build-container:1.5.7
@ -3395,6 +3416,7 @@ steps:
- '# The following command will fail if running code generators produces any diff
in output.'
- CODEGEN_VERIFY=1 make gen-cue
depends_on: []
image: grafana/build-container:1.5.7
name: verify-gen-cue
- commands:
@ -3662,6 +3684,7 @@ steps:
- '# The following command will fail if running code generators produces any diff
in output.'
- CODEGEN_VERIFY=1 make gen-cue
depends_on: []
image: grafana/build-container:1.5.7
name: verify-gen-cue
- commands:
@ -3788,6 +3811,7 @@ steps:
- '# The following command will fail if running code generators produces any diff
in output.'
- CODEGEN_VERIFY=1 make gen-cue
depends_on: []
image: grafana/build-container:1.5.7
name: verify-gen-cue
- commands:
@ -4345,13 +4369,13 @@ steps:
image: grafana/build-container:1.5.7
name: lint-frontend
- commands:
- ./bin/grabpl test-backend --edition enterprise
- go test -short -covermode=atomic -timeout=30m ./pkg/...
depends_on:
- wire-install
image: grafana/build-container:1.5.7
name: test-backend
- commands:
- ./bin/grabpl integration-tests --edition enterprise
- go test -run Integration -covermode=atomic -timeout=30m ./pkg/...
depends_on:
- wire-install
image: grafana/build-container:1.5.7
@ -4373,17 +4397,11 @@ steps:
image: grafana/build-container:1.5.7
name: lint-backend-enterprise2
- commands:
- ./bin/grabpl test-backend --edition enterprise2
- go test -tags=pro -covermode=atomic -timeout=30m ./pkg/...
depends_on:
- wire-install
image: grafana/build-container:1.5.7
name: test-backend-enterprise2
- commands:
- ./bin/grabpl integration-tests --edition enterprise2
depends_on:
- wire-install
image: grafana/build-container:1.5.7
name: test-backend-integration-enterprise2
trigger:
ref:
- refs/heads/v[0-9]*
@ -4465,15 +4483,32 @@ steps:
environment: {}
image: grafana/build-container:1.5.7
name: init-enterprise
- commands:
- '# It is required that code generated from Thema/CUE be committed and in sync
with its inputs.'
- '# The following command will fail if running code generators produces any diff
in output.'
- CODEGEN_VERIFY=1 make gen-cue
depends_on:
- init-enterprise
image: grafana/build-container:1.5.7
name: verify-gen-cue
- commands:
- make gen-go
depends_on:
- verify-gen-cue
image: grafana/build-container:1.5.7
name: wire-install
- commands:
- apt-get update
- apt-get install -yq postgresql-client
- dockerize -wait tcp://postgres:5432 -timeout 120s
- psql -p 5432 -h postgres -U grafanatest -d grafanatest -f devenv/docker/blocks/postgres_tests/setup.sql
- go clean -testcache
- ./bin/grabpl integration-tests --database postgres
- go list './pkg/...' | xargs -I {} sh -c 'go test -run Integration -covermode=atomic
-timeout=30m {}'
depends_on:
- init-enterprise
- wire-install
environment:
GRAFANA_TEST_DB: postgres
PGPASSWORD: grafanatest
@ -4487,9 +4522,10 @@ steps:
- cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql -P 3306 -u root
-prootpass
- go clean -testcache
- ./bin/grabpl integration-tests --database mysql
- go list './pkg/...' | xargs -I {} sh -c 'go test -run Integration -covermode=atomic
-timeout=30m {}'
depends_on:
- init-enterprise
- wire-install
environment:
GRAFANA_TEST_DB: mysql
MYSQL_HOST: mysql
@ -4499,7 +4535,7 @@ steps:
- dockerize -wait tcp://redis:6379/0 -timeout 120s
- ./bin/grabpl integration-tests
depends_on:
- init-enterprise
- wire-install
environment:
REDIS_URL: redis://redis:6379/0
image: grafana/build-container:1.5.7
@ -4508,7 +4544,7 @@ steps:
- dockerize -wait tcp://memcached:11211 -timeout 120s
- ./bin/grabpl integration-tests
depends_on:
- init-enterprise
- wire-install
environment:
MEMCACHED_HOSTS: memcached:11211
image: grafana/build-container:1.5.7
@ -4747,6 +4783,6 @@ kind: secret
name: gcp_upload_artifacts_key
---
kind: signature
hmac: 32e54be4bd96844f07ea81b7ac46b37aa10f755074526353afb3420323e0f2f4
hmac: c9b6fd34c919d871a153c3d82bfe8d62f126f1c672bd14636147cdeafe827c10
...

@ -93,7 +93,7 @@ def main_test_backend():
identify_runner_step(),
download_grabpl_step(),
gen_version_step(ver_mode),
verify_gen_cue_step(),
verify_gen_cue_step(edition="oss"),
wire_install_step(),
]
test_steps = [
@ -114,7 +114,7 @@ def get_steps(edition):
identify_runner_step(),
download_grabpl_step(),
gen_version_step(ver_mode),
verify_gen_cue_step(),
verify_gen_cue_step(edition="oss"),
wire_install_step(),
yarn_install_step(),
]
@ -220,7 +220,7 @@ def main_pipelines(edition):
volumes=volumes,
), pipeline(
name='main-integration-tests', edition=edition, trigger=trigger, services=services,
steps=[download_grabpl_step(), identify_runner_step(), verify_gen_cue_step(), wire_install_step(), ] + integration_test_steps,
steps=[download_grabpl_step(), identify_runner_step(), verify_gen_cue_step(edition="oss"), wire_install_step(), ] + integration_test_steps,
volumes=volumes,
), pipeline(
name='main-windows', edition=edition, trigger=dict(trigger, repo=['grafana/grafana']),

@ -91,7 +91,7 @@ def pr_test_backend():
identify_runner_step(),
download_grabpl_step(),
gen_version_step(ver_mode),
verify_gen_cue_step(),
verify_gen_cue_step(edition="oss"),
wire_install_step(),
]
test_steps = [
@ -115,7 +115,7 @@ def pr_pipelines(edition):
identify_runner_step(),
download_grabpl_step(),
gen_version_step(ver_mode),
verify_gen_cue_step(),
verify_gen_cue_step(edition="oss"),
wire_install_step(),
yarn_install_step(),
]
@ -153,7 +153,7 @@ def pr_pipelines(edition):
name='pr-build-e2e', edition=edition, trigger=trigger, services=[], steps=init_steps + build_steps,
), pipeline(
name='pr-integration-tests', edition=edition, trigger=trigger, services=services,
steps=[download_grabpl_step(), identify_runner_step(), verify_gen_cue_step(), wire_install_step(), ] + integration_test_steps,
steps=[download_grabpl_step(), identify_runner_step(), verify_gen_cue_step(edition="oss"), wire_install_step(), ] + integration_test_steps,
volumes=volumes,
), docs_pipelines(edition, ver_mode, trigger_docs())
]

@ -158,7 +158,7 @@ def get_steps(edition, ver_mode):
identify_runner_step(),
download_grabpl_step(),
gen_version_step(ver_mode),
verify_gen_cue_step(),
verify_gen_cue_step(edition),
wire_install_step(),
yarn_install_step(),
]
@ -192,7 +192,6 @@ def get_steps(edition, ver_mode):
test_steps.extend([
lint_backend_step(edition=edition2),
test_backend_step(edition=edition2),
test_backend_integration_step(edition=edition2),
])
build_steps.extend([
build_backend_step(edition=edition2, ver_mode=ver_mode, variants=['linux-amd64']),
@ -272,7 +271,7 @@ def get_oss_pipelines(trigger, ver_mode):
),
pipeline(
name='{}-oss-integration-tests'.format(ver_mode), edition=edition, trigger=trigger, services=services,
steps=[download_grabpl_step(), identify_runner_step(), verify_gen_cue_step(), wire_install_step(), ] + integration_test_steps,
steps=[download_grabpl_step(), identify_runner_step(), verify_gen_cue_step(edition), wire_install_step(), ] + integration_test_steps,
volumes=volumes,
)
])
@ -304,13 +303,10 @@ def get_enterprise_pipelines(trigger, ver_mode):
clone_enterprise_step(ver_mode),
init_enterprise_step(ver_mode)
]
for step in [wire_install_step(), yarn_install_step(), gen_version_step(ver_mode), verify_gen_cue_step()]:
for step in [wire_install_step(), yarn_install_step(), gen_version_step(ver_mode), verify_gen_cue_step(edition)]:
step.update(deps_on_clone_enterprise_step)
init_steps.extend([step])
for step in integration_test_steps:
step.update(deps_on_clone_enterprise_step)
windows_pipeline = pipeline(
name='{}-enterprise-windows'.format(ver_mode), edition=edition, trigger=trigger,
steps=[identify_runner_step('windows')] + windows_package_steps,
@ -334,7 +330,7 @@ def get_enterprise_pipelines(trigger, ver_mode):
),
pipeline(
name='{}-enterprise-integration-tests'.format(ver_mode), edition=edition, trigger=trigger, services=services,
steps=[download_grabpl_step(), identify_runner_step(), clone_enterprise_step(ver_mode), init_enterprise_step(ver_mode),] + integration_test_steps + [redis_integration_tests_step(), memcached_integration_tests_step()],
steps=[download_grabpl_step(), identify_runner_step(), clone_enterprise_step(ver_mode), init_enterprise_step(ver_mode), verify_gen_cue_step(edition), wire_install_step()] + integration_test_steps + [redis_integration_tests_step(), memcached_integration_tests_step()],
volumes=volumes,
),
])

@ -502,7 +502,7 @@ def build_plugins_step(edition, sign=False):
def test_backend_step(edition):
if edition == 'oss':
if edition == 'enterprise2':
return {
'name': 'test-backend' + enterprise2_suffix(edition),
'image': build_image,
@ -510,7 +510,7 @@ def test_backend_step(edition):
'wire-install',
],
'commands': [
'go test -short -covermode=atomic -timeout=30m ./pkg/...',
'go test -tags=pro -covermode=atomic -timeout=30m ./pkg/...',
],
}
else:
@ -521,12 +521,13 @@ def test_backend_step(edition):
'wire-install',
],
'commands': [
'./bin/grabpl test-backend --edition {}'.format(edition),
'go test -short -covermode=atomic -timeout=30m ./pkg/...',
],
}
def test_backend_integration_step(edition):
if edition == 'oss':
return {
'name': 'test-backend-integration',
'image': build_image,
@ -537,17 +538,6 @@ def test_backend_integration_step(edition):
'go test -run Integration -covermode=atomic -timeout=30m ./pkg/...',
],
}
else:
return {
'name': 'test-backend-integration' + enterprise2_suffix(edition),
'image': build_image,
'depends_on': [
'wire-install',
],
'commands': [
'./bin/grabpl integration-tests --edition {}'.format(edition),
],
}
@ -869,7 +859,6 @@ def publish_images_step(edition, ver_mode, mode, docker_repo, trigger=None):
def postgres_integration_tests_step(edition, ver_mode):
deps = []
cmds = [
'apt-get update',
'apt-get install -yq postgresql-client',
@ -878,17 +867,12 @@ def postgres_integration_tests_step(edition, ver_mode):
'devenv/docker/blocks/postgres_tests/setup.sql',
# Make sure that we don't use cached results for another database
'go clean -testcache',
"go list './pkg/...' | xargs -I {} sh -c 'go test -run Integration -covermode=atomic -timeout=30m {}'",
]
if edition == 'oss':
deps.extend(['wire-install'])
cmds.extend(["go list './pkg/...' | xargs -I {} sh -c 'go test -run Integration -covermode=atomic -timeout=30m {}'"])
else:
deps.extend(['grabpl'])
cmds.extend(['./bin/grabpl integration-tests --database postgres'])
return {
'name': 'postgres-integration-tests',
'image': build_image,
'depends_on': deps,
'depends_on': ['wire-install'],
'environment': {
'PGPASSWORD': 'grafanatest',
'GRAFANA_TEST_DB': 'postgres',
@ -899,7 +883,6 @@ def postgres_integration_tests_step(edition, ver_mode):
def mysql_integration_tests_step(edition, ver_mode):
deps = []
cmds = [
'apt-get update',
'apt-get install -yq default-mysql-client',
@ -907,17 +890,12 @@ def mysql_integration_tests_step(edition, ver_mode):
'cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql -P 3306 -u root -prootpass',
# Make sure that we don't use cached results for another database
'go clean -testcache',
"go list './pkg/...' | xargs -I {} sh -c 'go test -run Integration -covermode=atomic -timeout=30m {}'",
]
if edition == 'oss':
deps.extend(['wire-install'])
cmds.extend(["go list './pkg/...' | xargs -I {} sh -c 'go test -run Integration -covermode=atomic -timeout=30m {}'"])
else:
deps.extend(['grabpl'])
cmds.extend(['./bin/grabpl integration-tests --database mysql'])
return {
'name': 'mysql-integration-tests',
'image': build_image,
'depends_on': deps,
'depends_on': ['wire-install'],
'environment': {
'GRAFANA_TEST_DB': 'mysql',
'MYSQL_HOST': 'mysql',
@ -930,7 +908,7 @@ def redis_integration_tests_step():
return {
'name': 'redis-integration-tests',
'image': build_image,
'depends_on': ['init-enterprise'],
'depends_on': ['wire-install'],
'environment': {
'REDIS_URL': 'redis://redis:6379/0',
},
@ -945,7 +923,7 @@ def memcached_integration_tests_step():
return {
'name': 'memcached-integration-tests',
'image': build_image,
'depends_on': ['init-enterprise'],
'depends_on': ['wire-install'],
'environment': {
'MEMCACHED_HOSTS': 'memcached:11211',
},
@ -1170,10 +1148,14 @@ def get_windows_steps(edition, ver_mode):
return steps
def verify_gen_cue_step():
def verify_gen_cue_step(edition):
deps = []
if edition == "enterprise":
deps.extend(['init-enterprise'])
return {
'name': 'verify-gen-cue',
'image': build_image,
'depends_on': deps,
'commands': [
'# It is required that code generated from Thema/CUE be committed and in sync with its inputs.',
'# The following command will fail if running code generators produces any diff in output.',

Binary file not shown.
Loading…
Cancel
Save