~alpine/aports

3 2

[alpine-aports] [PATCH] testing/luakit: enable tests

Alex Raschi
Details
Message ID
<20190123151052.19776-1-raschi.alex@gmail.com>
Sender timestamp
1548256252
DKIM signature
missing
Download raw message
Patch: +75 -8
* move a dir in -doc subpackage too
---
 testing/luakit/APKBUILD    | 28 +++++++++++++------
 testing/luakit/tests.patch | 55 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 75 insertions(+), 8 deletions(-)
 create mode 100644 testing/luakit/tests.patch

diff --git a/testing/luakit/APKBUILD b/testing/luakit/APKBUILD
index d0cbf548d0..17ad52bb03 100644
--- a/testing/luakit/APKBUILD
+++ b/testing/luakit/APKBUILD
@@ -2,18 +2,18 @@
 # Maintainer:
 pkgname=luakit
 pkgver=2.1
-pkgrel=0
+pkgrel=1
 pkgdesc="Fast, small, webkit based browser framework extensible by Lua"
-url="https://github.com/luakit/luakit"
+url="https://luakit.github.io/"
 arch="all !s390x" # luajit is missing for s390x
-license="GPL-3.0"
-depends="lua5.1-filesystem lua5.1-luassert"
-depends_dev=""
+license="GPL-3.0-or-later"
+depends="gsettings-desktop-schemas lua5.1-filesystem"
 makedepends="webkit2gtk-dev luajit-dev"
-install=""
+checkdepends="xvfb luacheck lua5.1-luassert"
 subpackages="$pkgname-doc"
 source="$pkgname-$pkgver.tar.gz::https://github.com/$pkgname/$pkgname/archive/$pkgver.tar.gz
-	config-mk.patch"
+	config-mk.patch
+	tests.patch"
 builddir="$srcdir/$pkgname-$pkgver"
 
 build() {
@@ -21,10 +21,22 @@ build() {
 	make PREFIX=/usr USE_LUAJIT=1 DEVELOPMENT_PATHS=0
 }
 
+check() {
+	cd "$builddir"
+	make run-tests
+}
+
 package() {
 	cd "$builddir"
 	make PREFIX=/usr DESTDIR="$pkgdir" install
 }
 
+doc() {
+	mkdir -p "$subpkgdir"/usr/share/luakit
+	mv "$pkgdir"/usr/share/luakit/doc "$subpkgdir"/usr/share/luakit
+	default_doc
+}
+
 sha512sums="1daee7fe4bf5fad0f2c70d714c316914c601467facafdb22e4f27c18a691e249cefd5680ede834bcc555041afdc5d7e70610e2cd5e33db1ad8d9f2fe0327ccac  luakit-2.1.tar.gz
-d852a17bf202b18e75bda3885e421a957ce501ebbeb0ecd6e7a6379747e350878c9f95683a0385ce9daa719ddd02a3e5d5143ebd9ee892a469d8457e7a863b5a  config-mk.patch"
+d852a17bf202b18e75bda3885e421a957ce501ebbeb0ecd6e7a6379747e350878c9f95683a0385ce9daa719ddd02a3e5d5143ebd9ee892a469d8457e7a863b5a  config-mk.patch
+6d0b3a93b7bedcdd3ebe7283d734d013aa25683a9effc841f4a57aa8f2ea34dc68dc4bd35a22436d28e4011c60243047b72ff8d81affb349912de43e1e20232f  tests.patch"
diff --git a/testing/luakit/tests.patch b/testing/luakit/tests.patch
new file mode 100644
index 0000000000..3d9763f0d4
--- /dev/null
+++ b/testing/luakit/tests.patch
@@ -0,0 +1,55 @@
+--- a/clib/soup.c
+@@ -106,7 +106,7 @@ luaH_soup_set_cookies_storage(lua_State *L)
+         luaL_error(L, "cookies_storage cannot be empty");
+     g_free(cookies_storage);
+     cookies_storage = g_strdup(new_path);
+-    
++
+     if ((f = g_fopen(cookies_storage, "a")) != NULL) {
+         g_chmod(cookies_storage, 0600);
+         fclose(f);
+--- a/lib/binds.lua
+@@ -496,7 +496,7 @@ modes.add_cmds({
+                     callback = function (_, err)
+                         w:error(err)
+                     end,
+-                }) 
++                })
+             else
+                 w:error("No argument provided")
+             end
+--- a/lib/help_chrome.lua
+@@ -27,7 +27,8 @@ local index_html_template = [==[
+     </style>
+ </head>
+ <body>
+-    <header id="page-header"><h1>Luakit Help</h1><div class="rhs">version {version} / webkit {webkitversion}</div></header>
++    <header id="page-header"><h1>Luakit Help</h1><div
++    class="rhs">version {version} / webkit {webkitversion}</div></header>
+     <div class=content-margin>
+         <h2>About Luakit</h2>
+             <p>Luakit is a highly configurable, browser framework based on the <a
+--- a/tests/async/test_module_binds_have_descriptions.lua
+@@ -47,6 +47,7 @@ local function add_file_error(errors, file, error, ...)
+ end
+ 
+ T.test_module_binds_have_descriptions = function ()
++    require("newtab_chrome")
+     local files = test.find_files({"lib/"}, ".+%.lua$", {"_wm%.lua$", "modes%.lua", "unique_instance%.lua"})
+ 
+     local errors = {}
+--- a/tests/lib.lua
+@@ -115,7 +115,7 @@ function _M.wait(timeout)
+     shared_lib.traceback = debug.traceback("",2)
+ 
+     waiting = true
+-    timeout = timeout or 200
++    timeout = timeout or 1000
+     return coroutine.yield({timeout=timeout})
+ end
+ 
-- 
2.20.1



---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---
Leonardo Arena
Details
Message ID
<CAGG_d8D=rZc-r_y3VnYncQdK=VKUKUJs8S3J97yM-ve8ZNVjmA@mail.gmail.com>
In-Reply-To
<20190123151052.19776-1-raschi.alex@gmail.com> (view parent)
Sender timestamp
1549372401
DKIM signature
missing
Download raw message
Hi,

please see some comments below.

On Wed, Jan 23, 2019 at 4:11 PM Alex Raschi <raschi.alex@gmail.com> wrote:

> * move a dir in -doc subpackage too
> ---
>  testing/luakit/APKBUILD    | 28 +++++++++++++------
>  testing/luakit/tests.patch | 55 ++++++++++++++++++++++++++++++++++++++
>  2 files changed, 75 insertions(+), 8 deletions(-)
>  create mode 100644 testing/luakit/tests.patch
>
> diff --git a/testing/luakit/APKBUILD b/testing/luakit/APKBUILD
> index d0cbf548d0..17ad52bb03 100644
> --- a/testing/luakit/APKBUILD
> +++ b/testing/luakit/APKBUILD
> @@ -2,18 +2,18 @@
>  # Maintainer:
>  pkgname=luakit
>  pkgver=2.1
> -pkgrel=0
> +pkgrel=1
>  pkgdesc="Fast, small, webkit based browser framework extensible by Lua"
> -url="https://github.com/luakit/luakit"
> +url="https://luakit.github.io/"
>  arch="all !s390x" # luajit is missing for s390x
> -license="GPL-3.0"
> -depends="lua5.1-filesystem lua5.1-luassert"
> -depends_dev=""
> +license="GPL-3.0-or-later"
> +depends="gsettings-desktop-schemas lua5.1-filesystem"
>  makedepends="webkit2gtk-dev luajit-dev"
> -install=""
> +checkdepends="xvfb luacheck lua5.1-luassert"
>  subpackages="$pkgname-doc"
>  source="$pkgname-$pkgver.tar.gz::
> https://github.com/$pkgname/$pkgname/archive/$pkgver.tar.gz
> -       config-mk.patch"
> +       config-mk.patch
> +       tests.patch"
>  builddir="$srcdir/$pkgname-$pkgver"
>
>  build() {
> @@ -21,10 +21,22 @@ build() {
>         make PREFIX=/usr USE_LUAJIT=1 DEVELOPMENT_PATHS=0
>  }
>
> +check() {
> +       cd "$builddir"
> +       make run-tests
> +}
> +
>

The tests seem to use the local display server rathen than xvfb. They will
fail on the headless systems like the buildboxes.



>  package() {
>         cd "$builddir"
>         make PREFIX=/usr DESTDIR="$pkgdir" install
>  }
>
> +doc() {
> +       mkdir -p "$subpkgdir"/usr/share/luakit
> +       mv "$pkgdir"/usr/share/luakit/doc "$subpkgdir"/usr/share/luakit
> +       default_doc
> +}
> +
>


You can avoid defining a custom doc() function. Just move
usr/share/luakit/doc/* into "$pkgdir"/usr/share/doc/$pkgname/.
This is the approach been used so far to move stuff in doc subpkg.


Thanks!

/eo
Alex Raschi
Details
Message ID
<CAOcb4q6aoWfwBzXeK1KL6b8nif4GocPszP6Es8xVsxLq7TjTzw@mail.gmail.com>
In-Reply-To
<CAGG_d8D=rZc-r_y3VnYncQdK=VKUKUJs8S3J97yM-ve8ZNVjmA@mail.gmail.com> (view parent)
Sender timestamp
1549376458
DKIM signature
missing
Download raw message
Hi

> The tests seem to use the local display server rathen than xvfb. They
will
> fail on the headless systems like the buildboxes.

Prior to submitting the patch i tried running the tests on a standard
alpine chroot
(X wasn't running on the chroot and neither on the host) and they succeded.
I basically stopped X server and ran them from tty.

I don't know if there is a way to force it to use xvfb even when there is
another X
server running. I will do some research, but they should work on headless.

> You can avoid defining a custom doc() function. Just move
usr/share/luakit/doc/* into "$pkgdir"/usr/share/doc/$pkgname/.
> This is the approach been used so far to move stuff in doc subpkg.

Thanks for tip!

On Tue, Feb 5, 2019 at 1:13 PM Leonardo Arena <rnalrd@gmail.com> wrote:

> Hi,
>
> please see some comments below.
>
> On Wed, Jan 23, 2019 at 4:11 PM Alex Raschi <raschi.alex@gmail.com> wrote:
>
>> * move a dir in -doc subpackage too
>> ---
>>  testing/luakit/APKBUILD    | 28 +++++++++++++------
>>  testing/luakit/tests.patch | 55 ++++++++++++++++++++++++++++++++++++++
>>  2 files changed, 75 insertions(+), 8 deletions(-)
>>  create mode 100644 testing/luakit/tests.patch
>>
>> diff --git a/testing/luakit/APKBUILD b/testing/luakit/APKBUILD
>> index d0cbf548d0..17ad52bb03 100644
>> --- a/testing/luakit/APKBUILD
>> +++ b/testing/luakit/APKBUILD
>> @@ -2,18 +2,18 @@
>>  # Maintainer:
>>  pkgname=luakit
>>  pkgver=2.1
>> -pkgrel=0
>> +pkgrel=1
>>  pkgdesc="Fast, small, webkit based browser framework extensible by Lua"
>> -url="https://github.com/luakit/luakit"
>> +url="https://luakit.github.io/"
>>  arch="all !s390x" # luajit is missing for s390x
>> -license="GPL-3.0"
>> -depends="lua5.1-filesystem lua5.1-luassert"
>> -depends_dev=""
>> +license="GPL-3.0-or-later"
>> +depends="gsettings-desktop-schemas lua5.1-filesystem"
>>  makedepends="webkit2gtk-dev luajit-dev"
>> -install=""
>> +checkdepends="xvfb luacheck lua5.1-luassert"
>>  subpackages="$pkgname-doc"
>>  source="$pkgname-$pkgver.tar.gz::
>> https://github.com/$pkgname/$pkgname/archive/$pkgver.tar.gz
>> -       config-mk.patch"
>> +       config-mk.patch
>> +       tests.patch"
>>  builddir="$srcdir/$pkgname-$pkgver"
>>
>>  build() {
>> @@ -21,10 +21,22 @@ build() {
>>         make PREFIX=/usr USE_LUAJIT=1 DEVELOPMENT_PATHS=0
>>  }
>>
>> +check() {
>> +       cd "$builddir"
>> +       make run-tests
>> +}
>> +
>>
>
> The tests seem to use the local display server rathen than xvfb. They will
> fail on the headless systems like the buildboxes.
>
>
>
>>  package() {
>>         cd "$builddir"
>>         make PREFIX=/usr DESTDIR="$pkgdir" install
>>  }
>>
>> +doc() {
>> +       mkdir -p "$subpkgdir"/usr/share/luakit
>> +       mv "$pkgdir"/usr/share/luakit/doc "$subpkgdir"/usr/share/luakit
>> +       default_doc
>> +}
>> +
>>
>
>
> You can avoid defining a custom doc() function. Just move
> usr/share/luakit/doc/* into "$pkgdir"/usr/share/doc/$pkgname/.
> This is the approach been used so far to move stuff in doc subpkg.
>
>
> Thanks!
>
> /eo
>

[alpine-aports] [PATCH v2] testing/luakit: enable tests

Alex Raschi
Details
Message ID
<20190205142045.12926-1-raschi.alex@gmail.com>
In-Reply-To
<20190123151052.19776-1-raschi.alex@gmail.com> (view parent)
Sender timestamp
1549376445
DKIM signature
missing
Download raw message
Patch: +72 -8
* move a dir in -doc subpackage too
---
Changes v1 -> v2:
 - remove doc function
 testing/luakit/APKBUILD    | 25 +++++++++++------
 testing/luakit/tests.patch | 55 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 72 insertions(+), 8 deletions(-)
 create mode 100644 testing/luakit/tests.patch

diff --git a/testing/luakit/APKBUILD b/testing/luakit/APKBUILD
index d0cbf548d0..825814b4c4 100644
--- a/testing/luakit/APKBUILD
+++ b/testing/luakit/APKBUILD
@@ -2,18 +2,18 @@
 # Maintainer:
 pkgname=luakit
 pkgver=2.1
-pkgrel=0
+pkgrel=1
 pkgdesc="Fast, small, webkit based browser framework extensible by Lua"
-url="https://github.com/luakit/luakit"
+url="https://luakit.github.io/"
 arch="all !s390x" # luajit is missing for s390x
-license="GPL-3.0"
-depends="lua5.1-filesystem lua5.1-luassert"
-depends_dev=""
+license="GPL-3.0-or-later"
+depends="gsettings-desktop-schemas lua5.1-filesystem"
 makedepends="webkit2gtk-dev luajit-dev"
-install=""
+checkdepends="xvfb luacheck lua5.1-luassert"
 subpackages="$pkgname-doc"
 source="$pkgname-$pkgver.tar.gz::https://github.com/$pkgname/$pkgname/archive/$pkgver.tar.gz
-	config-mk.patch"
+	config-mk.patch
+	tests.patch"
 builddir="$srcdir/$pkgname-$pkgver"
 
 build() {
@@ -21,10 +21,19 @@ build() {
 	make PREFIX=/usr USE_LUAJIT=1 DEVELOPMENT_PATHS=0
 }
 
+check() {
+	cd "$builddir"
+	make run-tests
+}
+
 package() {
 	cd "$builddir"
 	make PREFIX=/usr DESTDIR="$pkgdir" install
+	mkdir -p "$pkgdir"/usr/share/doc/"$pkgname"
+	mv "$pkgdir"/usr/share/"$pkgname"/doc/* "$pkgdir"/usr/share/doc/"$pkgname"
+	rmdir "$pkgdir"/usr/share/"$pkgname"/doc
 }
 
 sha512sums="1daee7fe4bf5fad0f2c70d714c316914c601467facafdb22e4f27c18a691e249cefd5680ede834bcc555041afdc5d7e70610e2cd5e33db1ad8d9f2fe0327ccac  luakit-2.1.tar.gz
-d852a17bf202b18e75bda3885e421a957ce501ebbeb0ecd6e7a6379747e350878c9f95683a0385ce9daa719ddd02a3e5d5143ebd9ee892a469d8457e7a863b5a  config-mk.patch"
+d852a17bf202b18e75bda3885e421a957ce501ebbeb0ecd6e7a6379747e350878c9f95683a0385ce9daa719ddd02a3e5d5143ebd9ee892a469d8457e7a863b5a  config-mk.patch
+6d0b3a93b7bedcdd3ebe7283d734d013aa25683a9effc841f4a57aa8f2ea34dc68dc4bd35a22436d28e4011c60243047b72ff8d81affb349912de43e1e20232f  tests.patch"
diff --git a/testing/luakit/tests.patch b/testing/luakit/tests.patch
new file mode 100644
index 0000000000..3d9763f0d4
--- /dev/null
+++ b/testing/luakit/tests.patch
@@ -0,0 +1,55 @@
+--- a/clib/soup.c
+@@ -106,7 +106,7 @@ luaH_soup_set_cookies_storage(lua_State *L)
+         luaL_error(L, "cookies_storage cannot be empty");
+     g_free(cookies_storage);
+     cookies_storage = g_strdup(new_path);
+-    
++
+     if ((f = g_fopen(cookies_storage, "a")) != NULL) {
+         g_chmod(cookies_storage, 0600);
+         fclose(f);
+--- a/lib/binds.lua
+@@ -496,7 +496,7 @@ modes.add_cmds({
+                     callback = function (_, err)
+                         w:error(err)
+                     end,
+-                }) 
++                })
+             else
+                 w:error("No argument provided")
+             end
+--- a/lib/help_chrome.lua
+@@ -27,7 +27,8 @@ local index_html_template = [==[
+     </style>
+ </head>
+ <body>
+-    <header id="page-header"><h1>Luakit Help</h1><div class="rhs">version {version} / webkit {webkitversion}</div></header>
++    <header id="page-header"><h1>Luakit Help</h1><div
++    class="rhs">version {version} / webkit {webkitversion}</div></header>
+     <div class=content-margin>
+         <h2>About Luakit</h2>
+             <p>Luakit is a highly configurable, browser framework based on the <a
+--- a/tests/async/test_module_binds_have_descriptions.lua
+@@ -47,6 +47,7 @@ local function add_file_error(errors, file, error, ...)
+ end
+ 
+ T.test_module_binds_have_descriptions = function ()
++    require("newtab_chrome")
+     local files = test.find_files({"lib/"}, ".+%.lua$", {"_wm%.lua$", "modes%.lua", "unique_instance%.lua"})
+ 
+     local errors = {}
+--- a/tests/lib.lua
+@@ -115,7 +115,7 @@ function _M.wait(timeout)
+     shared_lib.traceback = debug.traceback("",2)
+ 
+     waiting = true
+-    timeout = timeout or 200
++    timeout = timeout or 1000
+     return coroutine.yield({timeout=timeout})
+ end
+ 
-- 
2.20.1



---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---