Bugzilla – Attachment 170540 Details for
Bug 37490
Add test to detect when yarn.lock is not updated
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37490: Add a test to detect when yarn.lock is not updated
Bug-37490-Add-a-test-to-detect-when-yarnlock-is-no.patch (text/plain), 3.03 KB, created by
Martin Renvoize (ashimema)
on 2024-08-21 08:56:51 UTC
(
hide
)
Description:
Bug 37490: Add a test to detect when yarn.lock is not updated
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-08-21 08:56:51 UTC
Size:
3.03 KB
patch
obsolete
>From 44fba73240e0f0d4942a14c810a8980e8b0229f4 Mon Sep 17 00:00:00 2001 >From: Mason James <mtj@kohaaloha.com> >Date: Fri, 26 Jul 2024 22:54:15 +1200 >Subject: [PATCH] Bug 37490: Add a test to detect when yarn.lock is not updated > >to test... > >1/ set koha repo to state where yarn.lock is not updated > > $ git reset --hard 67db70d4 > >2/ run test, observe FAIL > > $ prove ./xt/verify-yarnlock.t > ./xt/verify-yarnlock.t .. error Your lockfile needs to be updated, but yarn was run with `--frozen-lockfile`. > ./xt/verify-yarnlock.t .. 1/1 > # Failed test 'verify yarn.lock file is updated correctly' > ... > Result: FAIL > >3/ set koha repo to state where yarn.lock is updated > > $ yarn install > >4/ note yarn.lock is now updated > > $ git status > ... > modified: yarn.lock > >5/ run test, observe SUCCESS > > $ prove -v ./xt/verify-yarnlock.t > ./xt/verify-yarnlock.t .. > ok 1 - verify yarn.lock file is updated correctly > All tests successful. > Files=1, Tests=1, 1 wallclock secs ( 0.02 usr 0.01 sys + 1.16 cusr 0.27 csys = 1.46 CPU) > Result: PASS > >Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > xt/verify-yarnlock.t | 45 ++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 45 insertions(+) > create mode 100755 xt/verify-yarnlock.t > >diff --git a/xt/verify-yarnlock.t b/xt/verify-yarnlock.t >new file mode 100755 >index 00000000000..088495c9d87 >--- /dev/null >+++ b/xt/verify-yarnlock.t >@@ -0,0 +1,45 @@ >+#!/usr/bin/perl >+ >+# Copyright (C) 2024 KohaAloha Ltd. >+# >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+# This file tests that Koha's yarn.lock file is updated with the >+# packages.json file. If this test fails, the likely solution is to run >+# 'yarn install' to generate an updated yarn.lock file, then >+# 'git commit ./yarn.lock'. >+ >+use Modern::Perl; >+use Test::More tests => 1; >+ >+my $rc; >+ >+# if KTD dirs exists? >+if ( -d "/usr/local/share/.cache/yarn" and -d "/kohadevbox/node_modules" ) { >+ >+ # we use KTD's existing .cache/yarn and node_modules dirs >+ $rc = system("yarn check --modules-folder /kohadevbox/node_modules --cache-dir /usr/local/share/.cache/yarn"); >+ >+} else { >+ >+ # else, we just use yarn's currently set dirs >+ $rc = system("yarn check"); >+ >+} >+ >+# yarn returns a 256 value for this specific lockfile error, >+# but we assume any non-zero value is bad >+is( $rc, 0, "verify yarn.lock file is updated correctly" ); >-- >2.46.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 37490
:
169693
|
169698
|
169967
| 170540