release 0.9.0
This commit is contained in:
parent
aaab077c2d
commit
9a9543238b
3 changed files with 70 additions and 20 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
0.9.0 (2022-05-26)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
- allow file:// mirrors
|
||||||
|
- /var/cache/apt/archives/ is now allowed to contain packages
|
||||||
|
- add file-mirror-automount hook-dir
|
||||||
|
- set $MMDEBSTRAP_VERBOSITY in hooks
|
||||||
|
- rewrite coverage with multiple individual and skippable shell scripts
|
||||||
|
|
||||||
0.8.6 (2022-03-25)
|
0.8.6 (2022-03-25)
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
|
|
79
coverage.py
79
coverage.py
|
@ -5,6 +5,7 @@ import os
|
||||||
import sys
|
import sys
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import argparse
|
||||||
|
|
||||||
have_qemu = os.getenv("HAVE_QEMU", "yes") == "yes"
|
have_qemu = os.getenv("HAVE_QEMU", "yes") == "yes"
|
||||||
have_unshare = os.getenv("HAVE_UNSHARE", "yes") == "yes"
|
have_unshare = os.getenv("HAVE_UNSHARE", "yes") == "yes"
|
||||||
|
@ -16,14 +17,24 @@ all_dists = ["oldstable", "stable", "testing", "unstable"]
|
||||||
default_mode = "unshare" if have_unshare else "root"
|
default_mode = "unshare" if have_unshare else "root"
|
||||||
all_modes = ["auto", "root", "unshare", "fakechroot", "chrootless"]
|
all_modes = ["auto", "root", "unshare", "fakechroot", "chrootless"]
|
||||||
default_variant = "apt"
|
default_variant = "apt"
|
||||||
all_variants = ["extract", "custom", "essential", "apt", "minbase", "buildd", "-", "standard"]
|
all_variants = [
|
||||||
|
"extract",
|
||||||
|
"custom",
|
||||||
|
"essential",
|
||||||
|
"apt",
|
||||||
|
"minbase",
|
||||||
|
"buildd",
|
||||||
|
"-",
|
||||||
|
"standard",
|
||||||
|
]
|
||||||
default_format = "auto"
|
default_format = "auto"
|
||||||
all_formats = ["auto", "directory", "tar", "squashfs", "ext2", "null"]
|
all_formats = ["auto", "directory", "tar", "squashfs", "ext2", "null"]
|
||||||
|
|
||||||
only_dists = []
|
only_dists = []
|
||||||
|
|
||||||
mirror=os.getenv("mirror", "http://127.0.0.1/debian")
|
mirror = os.getenv("mirror", "http://127.0.0.1/debian")
|
||||||
hostarch=subprocess.check_output(["dpkg", "--print-architecture"]).decode().strip()
|
hostarch = subprocess.check_output(["dpkg", "--print-architecture"]).decode().strip()
|
||||||
|
|
||||||
|
|
||||||
def skip(condition, dist, mode, variant, fmt):
|
def skip(condition, dist, mode, variant, fmt):
|
||||||
if not condition:
|
if not condition:
|
||||||
|
@ -37,7 +48,29 @@ def skip(condition, dist, mode, variant, fmt):
|
||||||
break
|
break
|
||||||
return toskip
|
return toskip
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
parser = argparse.ArgumentParser()
|
||||||
|
parser.add_argument("test", nargs="*", help="only run these tests")
|
||||||
|
parser.add_argument(
|
||||||
|
"-x",
|
||||||
|
"--exitfirst",
|
||||||
|
action="store_const",
|
||||||
|
dest="maxfail",
|
||||||
|
const=1,
|
||||||
|
help="exit instantly on first error or failed test.",
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--maxfail",
|
||||||
|
metavar="num",
|
||||||
|
action="store",
|
||||||
|
type=int,
|
||||||
|
dest="maxfail",
|
||||||
|
default=0,
|
||||||
|
help="exit after first num failures or errors.",
|
||||||
|
)
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
onlyrun = None
|
onlyrun = None
|
||||||
if len(sys.argv) > 1:
|
if len(sys.argv) > 1:
|
||||||
onlyrun = sys.argv[1]
|
onlyrun = sys.argv[1]
|
||||||
|
@ -46,7 +79,7 @@ def main():
|
||||||
with open("coverage.txt") as f:
|
with open("coverage.txt") as f:
|
||||||
for test in Deb822.iter_paragraphs(f):
|
for test in Deb822.iter_paragraphs(f):
|
||||||
name = test["Test"]
|
name = test["Test"]
|
||||||
if onlyrun and name != onlyrun:
|
if args.test and name not in args.text:
|
||||||
continue
|
continue
|
||||||
tt = None
|
tt = None
|
||||||
if have_qemu:
|
if have_qemu:
|
||||||
|
@ -100,17 +133,21 @@ def main():
|
||||||
skipped = []
|
skipped = []
|
||||||
failed = []
|
failed = []
|
||||||
for i, (test, name, dist, mode, variant, fmt) in enumerate(tests):
|
for i, (test, name, dist, mode, variant, fmt) in enumerate(tests):
|
||||||
print("------------------------------------------------------------------------------")
|
print(
|
||||||
print("(%d/%d) %s"%(i+1,len(tests),name))
|
"------------------------------------------------------------------------------"
|
||||||
print("dist: %s"%dist)
|
)
|
||||||
print("mode: %s"%mode)
|
print("(%d/%d) %s" % (i + 1, len(tests), name))
|
||||||
print("variant: %s"%variant)
|
print("dist: %s" % dist)
|
||||||
print("format: %s"%fmt)
|
print("mode: %s" % mode)
|
||||||
print("------------------------------------------------------------------------------")
|
print("variant: %s" % variant)
|
||||||
with open("tests/"+name) as fin, open("shared/test.sh", "w") as fout:
|
print("format: %s" % fmt)
|
||||||
|
print(
|
||||||
|
"------------------------------------------------------------------------------"
|
||||||
|
)
|
||||||
|
with open("tests/" + name) as fin, open("shared/test.sh", "w") as fout:
|
||||||
for line in fin:
|
for line in fin:
|
||||||
for e in ["CMD", "SOURCE_DATE_EPOCH"]:
|
for e in ["CMD", "SOURCE_DATE_EPOCH"]:
|
||||||
line = line.replace("{{ "+e+" }}", os.getenv(e))
|
line = line.replace("{{ " + e + " }}", os.getenv(e))
|
||||||
line = line.replace("{{ DIST }}", dist)
|
line = line.replace("{{ DIST }}", dist)
|
||||||
line = line.replace("{{ MIRROR }}", mirror)
|
line = line.replace("{{ MIRROR }}", mirror)
|
||||||
line = line.replace("{{ MODE }}", mode)
|
line = line.replace("{{ MODE }}", mode)
|
||||||
|
@ -129,13 +166,16 @@ def main():
|
||||||
case "skip":
|
case "skip":
|
||||||
skipped.append((name, dist, mode, variant, fmt))
|
skipped.append((name, dist, mode, variant, fmt))
|
||||||
continue
|
continue
|
||||||
success = True
|
proc = subprocess.Popen(argv)
|
||||||
try:
|
try:
|
||||||
subprocess.check_call(argv)
|
proc.wait()
|
||||||
except:
|
except KeyboardInterrupt:
|
||||||
success = False
|
proc.kill()
|
||||||
if not success:
|
break
|
||||||
|
if proc.returncode != 0:
|
||||||
failed.append((name, dist, mode, variant, fmt))
|
failed.append((name, dist, mode, variant, fmt))
|
||||||
|
if args.maxfail and len(failed) >= args.maxfail:
|
||||||
|
break
|
||||||
if skipped:
|
if skipped:
|
||||||
print("skipped:")
|
print("skipped:")
|
||||||
for t in skipped:
|
for t in skipped:
|
||||||
|
@ -146,5 +186,6 @@ def main():
|
||||||
print(t)
|
print(t)
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
our $VERSION = '0.8.6';
|
our $VERSION = '0.9.0';
|
||||||
|
|
||||||
use English;
|
use English;
|
||||||
use Getopt::Long;
|
use Getopt::Long;
|
||||||
|
|
Loading…
Reference in a new issue