aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ci.testscript32
-rw-r--r--tests/publish.testscript91
-rw-r--r--tests/release.testscript134
3 files changed, 173 insertions, 84 deletions
diff --git a/tests/ci.testscript b/tests/ci.testscript
index bea287d..9d61fc0 100644
--- a/tests/ci.testscript
+++ b/tests/ci.testscript
@@ -59,6 +59,11 @@ init += $cxx -d prj 2>! &prj/**/bootstrap/***
windows = ($cxx.target.class == 'windows')
+# Normally we disable the progress indication that complicates stderr output
+# validation. When testing the progress indication specifically we need to
+# handle curl's progress carefully, as it is not always terminated with the
+# newline character on Windows.
+#
: single-pkg
:
{
@@ -68,10 +73,22 @@ windows = ($cxx.target.class == 'windows')
$clone_root_prj;
$init -C @cfg &prj-cfg/***;
+ $* --no-progress 2>>~%EOE%
+ %CI request is queued.*%
+ %reference: .+%
+ EOE
+ }
+
+ : progress
+ :
+ {
+ $clone_root_prj;
+ $init -C @cfg &prj-cfg/***;
+
$* 2>>~"%EOE%"
submitting to $server
%.*
- %CI request is queued.*%
+ %.*CI request is queued.*%
%reference: .+%
EOE
}
@@ -146,15 +163,15 @@ windows = ($cxx.target.class == 'windows')
+$g commit -m 'Create'
+$g push --set-upstream origin master
+ test.options += --no-progress
+
: both
:
{
$clone_prj;
$init -C @cfg &prj-cfg/***;
- $* 2>>~"%EOE%"
- submitting to $server
- %.*
+ $* 2>>~%EOE%
%CI request is queued.*%
%reference: .+%
EOE
@@ -170,9 +187,7 @@ windows = ($cxx.target.class == 'windows')
#
test.arguments = $regex.apply($test.arguments, '^(prj)$', '\1/libprj');
- $* 2>>~"%EOE%"
- submitting to $server
- %.*
+ $* 2>>~%EOE%
%CI request is queued.*%
%reference: .+%
EOE
@@ -198,8 +213,7 @@ windows = ($cxx.target.class == 'windows')
package: prj
version: 1.0.1
- %.*
- %CI request is queued.*%
+ %continue\\?.+ CI request is queued.*%
%reference: .+%
EOE
}
diff --git a/tests/publish.testscript b/tests/publish.testscript
index 55bc01a..935a8e1 100644
--- a/tests/publish.testscript
+++ b/tests/publish.testscript
@@ -43,7 +43,13 @@ g = git -C prj >! 2>!
# duplicate submissions. We will use unique version for each test,
# incrementing the patch version for 1.0.X.
#
-# Next version to use: 1.0.19
+# Next version to use: 1.0.20
+#
+
+# Normally we disable the progress indication that complicates stderr output
+# validation. When testing the progress indication specifically we need to
+# handle curl's progress carefully, as it is not always terminated with the
+# newline character on Windows.
#
: submit
:
@@ -64,16 +70,31 @@ g = git -C prj >! 2>!
$init -C @cfg &prj-cfg/***;
sed -i -e 's/^(version:) .*$/\1 1.0.1/' prj/manifest;
- $* 2>>~%EOE%
+ $* --no-progress 2>>~%EOE%
synchronizing:
upgrade prj/1.0.1
- submitting prj-1.0.1.tar.gz
- %.*
%package submission is queued(: \.*prj/1.0.1)?%d
%reference: .{12}%
EOE
}
+ : progress
+ :
+ {
+ $clone_root_prj;
+ $init -C @cfg &prj-cfg/***;
+ sed -i -e 's/^(version:) .*$/\1 1.0.19/' prj/manifest;
+
+ $* 2>>~%EOE%
+ synchronizing:
+ upgrade prj/1.0.19
+ submitting prj-1.0.19.tar.gz
+ %.*
+ %.*package submission is queued(: \.*prj/1.0.19)?%d
+ %reference: .{12}%
+ EOE
+ }
+
: no-cfg
:
{
@@ -117,6 +138,7 @@ g = git -C prj >! 2>!
: multi-pkg
:
{
+ test.options += --no-progress
test.arguments += --force=uncommitted --simulate 'success'
+$new -t empty prj &prj/***
@@ -132,12 +154,8 @@ g = git -C prj >! 2>!
$init -C @cfg &prj-cfg/***;
$* 2>>~%EOE%
- submitting libprj-1.0.2.tar.gz
- %.*
%package submission is queued(: \.*libprj/1.0.2)?%d
%reference: .{12}%
- submitting prj-1.0.2.tar.gz
- %.*
%package submission is queued(: \.*prj/1.0.2)?%d
%reference: .{12}%
EOE
@@ -155,8 +173,6 @@ g = git -C prj >! 2>!
test.arguments = $regex.apply($test.arguments, '^(prj)$', '\1/libprj');
$* 2>>~%EOE%
- submitting libprj-1.0.3.tar.gz
- %.*
%package submission is queued(: \.*prj/1.0.3)?%d
%reference: .{12}%
EOE
@@ -189,12 +205,8 @@ g = git -C prj >! 2>!
project: prj
section: stable
%warning: publishing using staged build2 toolchain%?
- continue? [y/n] submitting libprj-1.0.4.tar.gz
- %.*
- %package submission is queued\(: \\.*libprj/1.0.4\)?%d
+ %continue\\?\\.+ package submission is queued\(: \\.*libprj/1.0.4\)?%d
%reference: .{12}%
- submitting prj-1.0.4.tar.gz
- %.*
%package submission is queued\(: \\.*prj/1.0.4\)?%d
%reference: .{12}%
EOE
@@ -204,6 +216,7 @@ g = git -C prj >! 2>!
: commited-prj
:
{
+ test.options += --no-progress
test.arguments += --simulate 'success'
clone_prj = cp --no-cleanup -p -r ../prj ./ &prj/***
@@ -234,8 +247,6 @@ g = git -C prj >! 2>!
$g commit -a -m 'Version';
$* 2>>~%EOE%
- submitting prj-1.0.16.tar.gz
- %.*
%package submission is queued(: \.*prj/1.0.16)?%d
%reference: .{12}%
EOE
@@ -274,8 +285,6 @@ g = git -C prj >! 2>!
EOE
$* --force=snapshot 2>>~%EOE%
- %submitting prj-1.0.17-a.0.\.+.tar.gz%d
- %.*
%package submission is queued(: \.*prj/1.0.17-a.0.\.+)?%d
%reference: .{12}%
EOE
@@ -285,6 +294,7 @@ g = git -C prj >! 2>!
: non-vsc-prj
:
{
+ test.options += --no-progress
test.arguments += --simulate 'success'
clone_prj = cp --no-cleanup -p -r ../prj ./ &prj/***;
@@ -298,8 +308,6 @@ g = git -C prj >! 2>!
$* 2>>~%EOE%
synchronizing:
upgrade prj/1.0.18
- submitting prj-1.0.18.tar.gz
- %.*
%package submission is queued(: \.*prj/1.0.18)?%d
%reference: .{12}%
EOE
@@ -308,6 +316,7 @@ g = git -C prj >! 2>!
: failure
:
{
+ test.options += --no-progress
test.arguments += --force=uncommitted
: duplicate-archive
@@ -322,8 +331,6 @@ g = git -C prj >! 2>!
$* 2>>~%EOE% != 0
synchronizing:
upgrade prj/1.0.5
- submitting prj-1.0.5.tar.gz
- %.*
error: duplicate submission
% info: reference: .{12}%?
EOE
@@ -341,8 +348,6 @@ g = git -C prj >! 2>!
$* 2>>~%EOE% != 0
synchronizing:
upgrade prj/1.0.6
- submitting prj-1.0.6.tar.gz
- %.*
error: submission handling failed
% info: consider reporting this to .+ maintainers%
EOE
@@ -360,8 +365,6 @@ g = git -C prj >! 2>!
$* 2>>~%EOE% != 0
synchronizing:
upgrade prj/1.0.7
- submitting prj-1.0.7.tar.gz
- %.*
error: HTTP status code 500 (internal server error)
% info: consider reporting this to .+ maintainers%
EOE
@@ -414,14 +417,16 @@ g = git -C prj >! 2>!
$* >&2 2>>~%EOE%;
synchronizing:
upgrade prj/1.0.8
- pushing build2-control
+ pushing branch build2-control
%.*
submitting prj-1.0.8.tar.gz
- %.*
- %package submission is queued(: \.*prj/1.0.8)?%d
+ %.+
+ %.*package submission is queued(: \.*prj/1.0.8)?%d
%reference: .{12}%
EOE
+ test.options += --no-progress;
+
# Publish when both local and remote-tracking build2-control branches are
# present.
#
@@ -430,10 +435,6 @@ g = git -C prj >! 2>!
$* 2>>~%EOE%;
synchronizing:
upgrade prj/1.0.9
- pushing build2-control
- %.*
- submitting prj-1.0.9.tar.gz
- %.*
%package submission is queued(: \.*prj/1.0.9)?%d
%reference: .{12}%
EOE
@@ -448,10 +449,6 @@ g = git -C prj >! 2>!
$* 2>>~%EOE%;
synchronizing:
upgrade prj/1.0.10
- pushing build2-control
- %.*
- submitting prj-1.0.10.tar.gz
- %.*
%package submission is queued(: \.*prj/1.0.10)?%d
%reference: .{12}%
EOE
@@ -519,21 +516,19 @@ g = git -C prj >! 2>!
$* 2>>~%EOE% != 0;
synchronizing:
upgrade prj/1.0.12
- pushing build2-control
+ pushing branch build2-control
%.*
error: unable to push build2-control branch
info: run 'git fetch' and try again
EOE
+ test.options += --no-progress;
+
# Publish successfully after the fetch.
#
$g fetch;
$* 2>>~%EOE%;
- pushing build2-control
- %.*
- submitting prj-1.0.12.tar.gz
- %.*
%package submission is queued(: \.*prj/1.0.12)?%d
%reference: .{12}%
EOE
@@ -548,10 +543,7 @@ g = git -C prj >! 2>!
$* >&2 2>>~%EOE%;
synchronizing:
upgrade prj/1.0.13
- pushing build2-control
- %.*
- submitting prj-1.0.13.tar.gz
- %.*
+ Branch 'build2-control' set up to track remote branch 'build2-control' from 'origin'.
%package submission is queued(: \.*prj/1.0.13)?%d
%reference: .{12}%
EOE
@@ -577,7 +569,6 @@ g = git -C prj >! 2>!
$* 2>>~%EOE% != 0;
synchronizing:
upgrade prj/1.0.14
- pushing build2-control
%.*
error: unable to push build2-control branch
info: run 'git fetch' and try again
@@ -589,10 +580,6 @@ g = git -C prj >! 2>!
$g pull;
$* 2>>~%EOE%;
- pushing build2-control
- %.*
- submitting prj-1.0.14.tar.gz
- %.*
%package submission is queued(: \.*prj/1.0.14)?%d
%reference: .{12}%
EOE
diff --git a/tests/release.testscript b/tests/release.testscript
index 45d6867..7ed968f 100644
--- a/tests/release.testscript
+++ b/tests/release.testscript
@@ -56,7 +56,7 @@ log2 = $gp2 log '--pretty=format:"%d %s"'
: single-pkg
:
{
- test.arguments += --yes -q
+ test.arguments += --yes
: release
:
@@ -71,7 +71,10 @@ log2 = $gp2 log '--pretty=format:"%d %s"'
{
$clone_root_repos;
- $*;
+ $* 2>>~%EOE%;
+ %.+
+ pushing branch master, tag v0.1.0
+ EOE
$clone2;
$log2 >>:~%EOO%;
@@ -94,7 +97,10 @@ log2 = $gp2 log '--pretty=format:"%d %s"'
{
$clone_root_repos;
- $* --alpha;
+ $* --alpha 2>>~%EOE%;
+ %.+
+ pushing branch master, tag v0.1.0-a.1
+ EOE
$clone2;
$log2 >>:~%EOO%
@@ -109,7 +115,10 @@ log2 = $gp2 log '--pretty=format:"%d %s"'
{
$clone_root_repos;
- $* --beta;
+ $* --beta 2>>~%EOE%;
+ %.+
+ pushing branch master, tag v0.1.0-b.1
+ EOE
$clone2;
$log2 >>:~%EOO%
@@ -124,7 +133,10 @@ log2 = $gp2 log '--pretty=format:"%d %s"'
{
$clone_root_repos;
- $* --minor;
+ $* --minor 2>>~%EOE%;
+ %.+
+ pushing branch master, tag v0.2.0
+ EOE
$clone2;
$log2 >>:~%EOO%
@@ -139,7 +151,10 @@ log2 = $gp2 log '--pretty=format:"%d %s"'
{
$clone_root_repos;
- $* --major;
+ $* --major 2>>~%EOE%;
+ %.+
+ pushing branch master, tag v1.0.0
+ EOE
$clone2;
$log2 >>:~%EOO%
@@ -162,7 +177,10 @@ log2 = $gp2 log '--pretty=format:"%d %s"'
$* --open-beta 2>'error: --open-beta specified for final current version 0.1.0' != 0;
- $* --alpha --open-beta;
+ $* --alpha --open-beta 2>>~%EOE%;
+ %.+
+ pushing branch master, tag v0.1.0-a.1
+ EOE
$clone2;
$log2 >>:~%EOO%;
@@ -171,7 +189,10 @@ log2 = $gp2 log '--pretty=format:"%d %s"'
Create
EOO
- $* --beta --open-beta;
+ $* --beta --open-beta 2>>~%EOE%;
+ %.+
+ pushing branch master, tag v0.1.0-b.1
+ EOE
$pull2;
$log2 >>:~%EOO%
@@ -188,7 +209,10 @@ log2 = $gp2 log '--pretty=format:"%d %s"'
{
$clone_root_repos;
- $* --open-patch;
+ $* --open-patch 2>>~%EOE%;
+ %.+
+ pushing branch master, tag v0.1.0
+ EOE
$clone2;
$log2 >>:~%EOO%;
@@ -197,7 +221,12 @@ log2 = $gp2 log '--pretty=format:"%d %s"'
Create
EOO
- $*; # --open-patch is implied for bugfix release series.
+ # Note: --open-patch is implied for bugfix release series.
+ #
+ $* 2>>~%EOE%;
+ %.+
+ pushing branch master, tag v0.1.1
+ EOE
$pull2;
$log2 >>:~%EOO%
@@ -217,9 +246,20 @@ log2 = $gp2 log '--pretty=format:"%d %s"'
$* --alpha --open-minor 2>'error: --open-minor specified for alpha current version 0.1.0-a.1' != 0;
$* --beta --open-minor 2>'error: --open-minor specified for beta current version 0.1.0-b.1' != 0;
- $* --open-patch;
- $*;
- $* --open-minor;
+ $* --open-patch 2>>~%EOE%;
+ %.+
+ pushing branch master, tag v0.1.0
+ EOE
+
+ $* 2>>~%EOE%;
+ %.+
+ pushing branch master, tag v0.1.1
+ EOE
+
+ $* --open-minor 2>>~%EOE%;
+ %.+
+ pushing branch master, tag v0.1.2
+ EOE
$clone2;
$log2 >>:~%EOO%
@@ -238,7 +278,10 @@ log2 = $gp2 log '--pretty=format:"%d %s"'
{
$clone_root_repos;
- $* --open-major;
+ $* --open-major 2>>~%EOE%;
+ %.+
+ pushing branch master, tag v0.1.0
+ EOE
$clone2;
$log2 >>:~%EOO%
@@ -259,7 +302,10 @@ log2 = $gp2 log '--pretty=format:"%d %s"'
{
$clone_root_repos;
- $* --no-open;
+ $* --no-open 2>>~%EOE%;
+ %.+
+ pushing branch master, tag v0.1.0
+ EOE
$clone2;
$log2 >>:~%EOO%;
@@ -267,7 +313,10 @@ log2 = $gp2 log '--pretty=format:"%d %s"'
Create
EOO
- $* --open;
+ $* --open 2>>~%EOE%;
+ %.+
+ pushing branch master
+ EOE
$pull2;
$log2 >>:~%EOO%
@@ -282,7 +331,10 @@ log2 = $gp2 log '--pretty=format:"%d %s"'
{
$clone_root_repos;
- $* --no-tag;
+ $* --no-tag 2>>~%EOE%;
+ %.+
+ pushing branch master
+ EOE
$clone2;
$log2 >>:~%EOO%;
@@ -296,7 +348,9 @@ log2 = $gp2 log '--pretty=format:"%d %s"'
info: use --force=snapshot to tag anyway
EOE
- $* --tag --force=snapshot;
+ $* --tag --force=snapshot 2>>~%EOE%;
+ %pushing branch master, tag v0.2.0-a.0.\.+%d
+ EOE
$pull2;
$log2 >>:~%EOO%
@@ -311,7 +365,10 @@ log2 = $gp2 log '--pretty=format:"%d %s"'
{
$clone_root_repos;
- $* --no-tag --no-open;
+ $* --no-tag --no-open 2>>~%EOE%;
+ %.+
+ pushing branch master
+ EOE
$clone2;
$log2 >>:~%EOO%;
@@ -319,7 +376,9 @@ log2 = $gp2 log '--pretty=format:"%d %s"'
Create
EOO
- $* --tag;
+ $* --tag 2>>EOE;
+ pushing branch master, tag v0.1.0
+ EOE
$pull2;
$log2 >>:~%EOO%;
@@ -327,7 +386,10 @@ log2 = $gp2 log '--pretty=format:"%d %s"'
Create
EOO
- $* --open;
+ $* --open 2>>~%EOE%;
+ %.+
+ pushing branch master
+ EOE
$pull2;
$log2 >>:~%EOO%
@@ -348,6 +410,7 @@ log2 = $gp2 log '--pretty=format:"%d %s"'
: validate-manifest
{
+ test.options += -q
test.arguments += --push
: file-value
@@ -406,7 +469,7 @@ log2 = $gp2 log '--pretty=format:"%d %s"'
$* --no-commit;
$gp commit -a -m 'Release version';
- $* --tag --push;
+ $* --tag --push -q;
$clone2;
$log2 >>:~%EOO%
@@ -419,6 +482,8 @@ log2 = $gp2 log '--pretty=format:"%d %s"'
: revision
:
{
+ test.options += -q
+
+$clone_root_repos
+$* --no-open --push
@@ -532,6 +597,8 @@ log2 = $gp2 log '--pretty=format:"%d %s"'
: open
:
{
+ test.options += -q
+
: unstaged
:
{
@@ -589,6 +656,26 @@ log2 = $gp2 log '--pretty=format:"%d %s"'
Create
EOO
}
+
+ : no-progress
+ :
+ {
+ $clone_root_repos;
+
+ $* --push --no-progress 2>>~%EOE%;
+ %\.+ Release version 0.1.0%d
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+ %\.+ Change version to 0.2.0-a.0.z%d
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+ EOE
+
+ $clone2;
+ $log2 >>:~%EOO%
+ % \(HEAD -> master, \.*\) Change version to 0.2.0-a.0.z%d
+ (tag: v0.1.0) Release version 0.1.0
+ Create
+ EOO
+ }
}
: multi-pkg
@@ -613,7 +700,8 @@ log2 = $gp2 log '--pretty=format:"%d %s"'
+$gp commit -m 'Create'
+$gp push --set-upstream origin master
- test.arguments += --push -q
+ test.options += -q
+ test.arguments += --push
: patch
: