]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(cypress): drop unwanted docker output characters 47379/head
authorskjnldsv <skjnldsv@protonmail.com>
Thu, 22 Aug 2024 10:03:32 +0000 (12:03 +0200)
committerJohn Molakvoæ <skjnldsv@users.noreply.github.com>
Thu, 22 Aug 2024 11:32:59 +0000 (13:32 +0200)
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
cypress/dockerNode.ts

index 2c8aa6c510911a88bf5a5ea0d3dff39e15f8262e..a9e8c7c6c45743f7fc930fe7a608adf0c631c979 100644 (file)
@@ -136,8 +136,8 @@ export const configureNextcloud = async function() {
        const hashing = await runExec(container, ['php', 'occ', 'config:system:get', 'hashing_default_password'])
 
        console.log('├─ Checking APCu configuration... 👀')
-       if (!distributed.trim().includes('\\OC\\Memcache\\APCu')
-               || !local.trim().includes('\\OC\\Memcache\\APCu')
+       if (!distributed.trim().includes('Memcache\\APCu')
+               || !local.trim().includes('Memcache\\APCu')
                || !hashing.trim().includes('true')) {
                console.log('└─ APCu is not properly configured 🛑')
                throw new Error('APCu is not properly configured')
@@ -294,9 +294,14 @@ const runExec = async function(
                        if (stream) {
                                stream.setEncoding('utf-8')
                                stream.on('data', str => {
+                                       str = str.trim()
+                                               // Remove non printable characters
+                                               .replace(/[^\x20-\x7E]+/g, '')
+                                               // Remove non alphanumeric leading characters
+                                               .replace(/^[^a-z]/gi, '')
                                        output += str
-                                       if (verbose && str.trim() !== '') {
-                                               console.log(`├─ ${str.trim().replace(/\n/gi, '\n├─ ')}`)
+                                       if (verbose && str !== '') {
+                                               console.log(`├─ ${str.replace(/\n/gi, '\n├─ ')}`)
                                        }
                                })
                                stream.on('end', () => resolve(output))