Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

Commit

Permalink
Merge branch 'master' into modify_1400
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaudill authored Jun 21, 2024
2 parents fc5c89a + be42e3e commit a9b1e23
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 19 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.38~pre
0.39~pre
17 changes: 9 additions & 8 deletions bin/ch-test
Original file line number Diff line number Diff line change
Expand Up @@ -299,16 +299,17 @@ pedantry_set () {
if [[ $ch_pedantic == no ]]; then
ch_pedantic= # proper boolean
fi
# The motivation here is that in pedantic mode, we want to run all the
# tests we reasonably can. So, if the user *has* sudo, then default --sudo
# to yes. What is a little awkward is that “sudo -v” can generate a
# password prompt in the middle of the status output. An alternative is
# “sudo -nv”, which doesn’t; drawbacks are that you have to analyze the
# output (not exit code) and it generates a failed password log message if
# there is not already a sudo session going.
# Motivation here: In pedantic mode, we want to run all the tests we
# reasonably can. So, if the user *has* sudo, then default --sudo to yes.
# What is a little awkward is that “sudo true” can generate a password
# prompt in the middle of the status output. An alternative is “sudo -nv”,
# which doesn’t; drawbacks are that you have to analyze the output (not
# exit code) and it generates a failed password log message if there is
# not already a sudo session going. We also used to use “sudo -v”, which
# prompts for a password even if you have passwordless sudo set up.
if [[ -n $ch_pedantic ]] \
&& command -v sudo > /dev/null \
&& sudo -v > /dev/null 2>&1; then
&& sudo true > /dev/null 2>&1; then
use_sudo_default=yes
else
use_sudo_default=
Expand Down
14 changes: 7 additions & 7 deletions doc/_loc.rst
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
.. Do not edit this file — it’s auto-generated.
We pride ourselves on keeping Charliecloud lightweight and simple. The lines
of code as of version 0.37 is:
of code as of version 0.38 is:

.. list-table::

* - Program itself
- 9079
- 9087
* - Test suite & examples
- 12019
- 12086
* - Documentation
- 6416
- 6526
* - Build system
- 1294
- 1298
* - Packaging
- 629
* - Miscellaneous
- 506
- 509
* - Total
- 29943
- 30135

These include code only, excluding blank lines and comments. They were counted
using `cloc <https://github.com/AlDanial/cloc>`_ version 1.96.
Expand Down
3 changes: 2 additions & 1 deletion test/build/50_dockerfile.bats
Original file line number Diff line number Diff line change
Expand Up @@ -1160,7 +1160,8 @@ EOF
[[ $status -ne 0 ]]
[[ $output = *'error: no context because '?'-'?' given'* \
|| $output = *'COPY failed: file not found in build context or'* \
|| $output = *'no such file or directory'* \
|| $output = *'no such file or directory'*
|| $output = *'not found'*
|| $output = *'failed to compute cache key: failed to calculate checksum of ref'* ]]
}

Expand Down
2 changes: 1 addition & 1 deletion test/common.bash
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ fi
# Do we have and want sudo?
if [[ $CH_TEST_SUDO ]] \
&& command -v sudo >/dev/null 2>&1 \
&& sudo -v > /dev/null 2>&1; then
&& sudo true > /dev/null 2>&1; then
# This isn’t super reliable; it returns true if we have *any* sudo
# privileges, not specifically to run the commands we want to run.
ch_have_sudo=yes
Expand Down
12 changes: 11 additions & 1 deletion test/force-auto.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class Test(abc.ABC):
base = None
config = None
scope = Scope.FULL
skip_reason = None
prep_run = None
runs = { Run.UNNEEDED_FAIL: "false",
Run.UNNEEDED_WIN: "true" }
Expand All @@ -83,6 +84,13 @@ class Test(abc.ABC):
def build2_post_hook(self):
return ""

@property
def skip(self):
if (self.skip_reason is None):
return ""
else:
return "skip '%s'" % self.skip_reason

def as_grep_files(self, grep_files, image, invert=False):
cmds = []
for (re, path) in grep_files:
Expand Down Expand Up @@ -174,7 +182,7 @@ echo "$output"
# emit the test
print(f"""
@test "ch-image --force: {self}" {{
{skip}
{self.skip}
scope {scope}
{arch_excludes}

Expand Down Expand Up @@ -241,6 +249,7 @@ class T_RHEL_UBI_8(RHEL8):
class CentOS_8(RHEL8, EPEL_Mixin):
prep_run = "dnf install -y epel-release"
class T_CentOS_8_Stream(CentOS_8):
skip_reason = "issue #1904"
# CentOS Stream pulls from quay.io per the CentOS wiki:
# https://wiki.centos.org/FAQ/CentOSStream#What_artifacts_are_built.3F
base = "quay.io/centos/centos:stream8"
Expand All @@ -261,6 +270,7 @@ class T_Rocky_8(CentOS_8):
class Fedora(RHEL8):
config = "fedora"
class T_Fedora_26(Fedora):
skip_reason = "issue #1904"
# We would prefer to test the lowest supported --force version, 24,
# but the ancient version of dnf it has doesn't fail the transaction when
# a package fails so we test with 26 instead.
Expand Down

0 comments on commit a9b1e23

Please sign in to comment.