~mil/sxmo-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
4 3

[PATCH sxmo-utils v3 1/2] spec_helper: include sxmo_common.sh for common aliases

Details
Message ID
<20220417054934.9569-1-anjan@momi.ca>
DKIM signature
pass
Download raw message
Patch: +4 -0
From: Jami Kettunen <jamipkettunen@gmail.com>

Otherwise running shellspec breaks due to things such as potentially
using a GNU coreutils find on different systems.

Signed-off-by: Jami Kettunen <jami.kettunen@protonmail.com>
Signed-off-by: Anjandev Momi <anjan@momi.ca>
---
 spec/spec_helper.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/spec/spec_helper.sh b/spec/spec_helper.sh
index 806f3dd..53c70ea 100644
--- a/spec/spec_helper.sh
+++ b/spec/spec_helper.sh
@@ -7,6 +7,10 @@
# so it is better to set them here.
# set -eu

# Include common aliases such as find='busybox find' to avoid breaking
# expected coreutils environment.
. scripts/core/sxmo_common.sh

# This callback function will be invoked only once before loading specfiles.
spec_helper_precheck() {
  # Available functions: info, warn, error, abort, setenv, unsetenv
-- 
2.35.2

[PATCH sxmo-utils v3 2/2] add test to check if tests are ran with sxmo_common.sh loaded

Details
Message ID
<20220417054934.9569-2-anjan@momi.ca>
In-Reply-To
<20220417054934.9569-1-anjan@momi.ca> (view parent)
DKIM signature
pass
Download raw message
Patch: +24 -0
This test checks if our tests are being ran with sxmo_common.sh loaded
---
 .build.yml                            |  2 ++
 spec/helper/jq.sh                     |  7 +++++++
 spec/scripts/core/sxmo_common_spec.sh | 15 +++++++++++++++
 3 files changed, 24 insertions(+)
 create mode 100644 spec/helper/jq.sh
 create mode 100644 spec/scripts/core/sxmo_common_spec.sh

diff --git a/.build.yml b/.build.yml
index 10245f3..78f7974 100644
--- a/.build.yml
+++ b/.build.yml
@@ -3,6 +3,8 @@ packages:
  - shellcheck
  - editorconfig-checker
  - shellspec
  - gojq
  - jq
sources:
  - https://git.sr.ht/~mil/sxmo-utils
tasks:
diff --git a/spec/helper/jq.sh b/spec/helper/jq.sh
new file mode 100644
index 0000000..51b4f36
--- /dev/null
+++ b/spec/helper/jq.sh
@@ -0,0 +1,7 @@
#!/bin/sh

# include common definitions
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh

jq -v | cut -d" " -f1
diff --git a/spec/scripts/core/sxmo_common_spec.sh b/spec/scripts/core/sxmo_common_spec.sh
new file mode 100644
index 0000000..dddce58
--- /dev/null
+++ b/spec/scripts/core/sxmo_common_spec.sh
@@ -0,0 +1,15 @@
#!/bin/sh

# shellcheck disable=SC2155
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors

# This file is to investigate whether sxmo_common.sh is loaded in tests

Describe 'sxmo_common.sh'
	It 'runs all tests with sxmo_common.sh loaded'
		When call sh spec/helper/jq.sh
		The output should equal 'gojq'
		The status should be success
	End
End
-- 
2.35.2

[sxmo-utils/patches/.build.yml] build failed

builds.sr.ht <builds@sr.ht>
Details
Message ID
<CJCA36R5F7TR.AKD91WDK7V0Z@cirno2>
In-Reply-To
<20220417054934.9569-2-anjan@momi.ca> (view parent)
DKIM signature
missing
Download raw message
sxmo-utils/patches/.build.yml: FAILED in 23s

[spec_helper: include sxmo_common.sh for common aliases][0] v3 from [Anjandev Momi][1]

[0]: https://lists.sr.ht/~mil/sxmo-devel/patches/31224
[1]: anjan@momi.ca

✗ #738442 FAILED sxmo-utils/patches/.build.yml https://builds.sr.ht/~mil/job/738442

Re: [sxmo-utils/patches/.build.yml] build failed

Details
Message ID
<87ee1wmf2c.fsf@momi.ca>
In-Reply-To
<CJCA36R5F7TR.AKD91WDK7V0Z@cirno2> (view parent)
DKIM signature
pass
Download raw message
It seems our tests dont load sxmo_common.sh. This is problematic....
--
w:] www.momi.ca
pgp:] https://momi.ca/publickey.txt

Re: [PATCH sxmo-utils v3 2/2] add test to check if tests are ran with sxmo_common.sh loaded

Details
Message ID
<2RBALRZPKPS5T.21QNOVAYYW8QK@stacyharper.net>
In-Reply-To
<20220417054934.9569-2-anjan@momi.ca> (view parent)
DKIM signature
pass
Download raw message
Why not ? It can prevent a spec developer to use incompatible api.

Applied !

To git.sr.ht:~mil/sxmo-utils
   7899904e..faf766cc  faf766cc -> master
Reply to thread Export thread (mbox)