Skip to content

Commit

Permalink
upgrade: Have all frameworks test upgrade from v0.27.0
Browse files Browse the repository at this point in the history
- rename the files in test/upgrade so that they run when upgrading
  from v0.27.0
- set the legacy-upgrade, cloudtest-upgrade and the platform-checks based
  upgrade CI jobs to all upgrade from the last released version
- update bin/bump-version so it renames files when creating the PR to
  bump main to the -dev version.
  • Loading branch information
philip-stoev committed Oct 14, 2022
1 parent a049dbc commit 954dfe4
Show file tree
Hide file tree
Showing 54 changed files with 38 additions and 19 deletions.
12 changes: 12 additions & 0 deletions .shellcheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright Materialize, Inc. and contributors. All rights reserved.
#
# Use of this software is governed by the Business Source License
# included in the LICENSE file at the root of this repository.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software will be governed
# by the Apache License, Version 2.0.

# Style lint about using Bash parameter expansion in `sed` has false positives
# when variable indirection is involved.
disable=SC2001
14 changes: 13 additions & 1 deletion bin/bump-version
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,22 @@ sed -i.bak \
"s/^version = .*/version = \"$version\"/" \
src/{compute,environmentd,storaged}/Cargo.toml

if ! [[ "$version" = *dev || "$version" = *post ]]; then
if ! [[ "$version" = *dev ]]; then
sed -i.bak \
"s/^Licensed Work:.*/Licensed Work: Materialize Version v$version/" \
LICENSE
else
# Rename all upgrade tests that reference `current_source` to explicitly
# reference the version of the last release.
IFS='.' read -r -a parts <<< "$version"
((parts[1]--))
last_version="${parts[0]}.${parts[1]}.0"
for file in test/upgrade/*current_source*; do
if [[ "$file" = *example* ]]; then
continue
fi
git mv "$file" "$(echo "$file" | sed "s/current_source/v$last_version/")"
done
fi

rm -f src/{compute,environmentd,storaged}/Cargo.toml.bak LICENSE.bak
Expand Down
12 changes: 4 additions & 8 deletions ci/nightly/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ steps:
args: [--scenario=RestartRedpanda, --execution-mode=oneatatime]

- id: checks-upgrade-entire-mz
label: "Upgrade entire Mz from v0.27.0-alpha.23"
label: "Platform checks upgrade, whole-Mz restart"
timeout_in_minutes: 30
agents:
queue: linux-x86_64
Expand All @@ -414,7 +414,7 @@ steps:
args: [--scenario=UpgradeEntireMz]

- id: checks-upgrade-computed-first
label: "Upgrade computed from v0.27.0-alpha.23 first"
label: "Platform checks upgrade, restarting computed first"
timeout_in_minutes: 30
agents:
queue: linux-x86_64
Expand All @@ -424,7 +424,7 @@ steps:
args: [--scenario=UpgradeComputedFirst]

- id: checks-upgrade-computed-last
label: "Upgrade computed from v0.27.0-alpha.23 last"
label: "Platform checks upgrade, restarting computed last"
timeout_in_minutes: 30
agents:
queue: linux-x86_64
Expand All @@ -434,14 +434,10 @@ steps:
args: [--scenario=UpgradeComputedLast]

- id: cloudtest-upgrade
label: "Cloudtest upgrade from main to main"
label: "Platform checks upgrade in Cloudtest/K8s"
timeout_in_minutes: 30
agents:
queue: linux-x86_64
plugins:
- ./ci/plugins/mzcompose:
composition: platform-checks
args: [--scenario=UpgradeComputedLast]
artifact_paths: junit_cloudtest_*.xml
plugins:
- ./ci/plugins/cloudtest:
Expand Down
6 changes: 3 additions & 3 deletions ci/test/pipeline.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -288,15 +288,15 @@ steps:
agents:
queue: linux-x86_64

- id: upgrade
label: Upgrade tests
- id: legacy-upgrade
label: Legacy upgrade tests
depends_on: build-x86_64
timeout_in_minutes: 60
artifact_paths: junit_mzcompose_*.xml
plugins:
- ./ci/plugins/mzcompose:
composition: upgrade
args: [--most-recent, "0"]
args: [--most-recent, "1"]
agents:
queue: linux-x86_64

Expand Down
3 changes: 2 additions & 1 deletion misc/python/materialize/checks/scenarios_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

from typing import List

from materialize import util
from materialize.checks.actions import Action, Initialize, Manipulate, Sleep, Validate
from materialize.checks.mzcompose_actions import (
KillComputed,
Expand All @@ -27,7 +28,7 @@
)
from materialize.checks.scenarios import Scenario

LAST_RELEASED_VERSION = "v0.27.0-alpha.23"
LAST_RELEASED_VERSION = f"v{util.released_materialize_versions()[0]}"


class UpgradeEntireMz(Scenario):
Expand Down
10 changes: 4 additions & 6 deletions test/cloudtest/test_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import pytest

from materialize import util
from materialize.checks.actions import Action, Initialize, Manipulate, Validate
from materialize.checks.all_checks import * # noqa: F401 F403
from materialize.checks.checks import Check
Expand All @@ -21,10 +22,6 @@
from materialize.cloudtest.k8s.environmentd import EnvironmentdStatefulSet
from materialize.cloudtest.wait import wait

# This will 'upgrade' from the current source.
# Once a stable release is out, we need to get its DockerHub tag in here
LAST_RELEASED_VERSION = None


class ReplaceEnvironmentdStatefulSet(Action):
"""Change the image tag of the environmentd stateful set, re-create the definition and replace the existing one."""
Expand Down Expand Up @@ -81,9 +78,10 @@ def actions(self) -> List[Action]:

@pytest.mark.long
def test_upgrade() -> None:
"""Test upgrade from LAST_RELEASED_VERSION to the current source by running all the Platform Checks"""
"""Test upgrade from the last released verison to the current source by running all the Platform Checks"""
last_released_version = f"v{util.released_materialize_versions()[0]}"

mz = MaterializeApplication(tag=LAST_RELEASED_VERSION)
mz = MaterializeApplication(tag=last_released_version)
wait(condition="condition=Ready", resource="pod/compute-cluster-u1-replica-1-0")

executor = CloudtestExecutor(application=mz)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 954dfe4

Please sign in to comment.