aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2024-02-22 10:02:15 -0800
committerKhem Raj <raj.khem@gmail.com>2024-02-22 12:59:38 -0800
commit343338e95565c2a3e2b1e8fbc4fce325ca0ea2f8 (patch)
tree4db0b36d217858d84fa24735079f2e02fd802900
parent1e853f5c5f8db616baac7dd17634cf4807a70e7d (diff)
downloadmeta-openembedded-contrib-343338e95565c2a3e2b1e8fbc4fce325ca0ea2f8.tar.gz
python3-jsmin: Fix ptests to run with python 3.12+
Remove it from problematic tests list ot fast list as it runs ok now. Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-python/conf/include/ptest-packagelists-meta-python.inc1
-rw-r--r--meta-python/recipes-devtools/python/python3-jsmin/7a75d76c2d6bfb917f30ced8f5c0a9a4157f7819.patch82
-rw-r--r--meta-python/recipes-devtools/python/python3-jsmin/run-ptest3
-rw-r--r--meta-python/recipes-devtools/python/python3-jsmin_3.0.1.bb1
4 files changed, 84 insertions, 3 deletions
diff --git a/meta-python/conf/include/ptest-packagelists-meta-python.inc b/meta-python/conf/include/ptest-packagelists-meta-python.inc
index c899166a7c..790d5b019d 100644
--- a/meta-python/conf/include/ptest-packagelists-meta-python.inc
+++ b/meta-python/conf/include/ptest-packagelists-meta-python.inc
@@ -76,7 +76,6 @@ PTESTS_PROBLEMS_META_PYTHON ="\
python3-dnspython \
python3-fastjsonschema \
python3-gpiod \
- python3-jsmin \
python3-ordered-set \
python3-pillow \
python3-pint \
diff --git a/meta-python/recipes-devtools/python/python3-jsmin/7a75d76c2d6bfb917f30ced8f5c0a9a4157f7819.patch b/meta-python/recipes-devtools/python/python3-jsmin/7a75d76c2d6bfb917f30ced8f5c0a9a4157f7819.patch
new file mode 100644
index 0000000000..2646e2f5a0
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-jsmin/7a75d76c2d6bfb917f30ced8f5c0a9a4157f7819.patch
@@ -0,0 +1,82 @@
+From 7a75d76c2d6bfb917f30ced8f5c0a9a4157f7819 Mon Sep 17 00:00:00 2001
+From: aekoroglu <ali.erdinc.koroglu@intel.com>
+Date: Fri, 24 Jun 2022 14:12:59 +0300
+Subject: [PATCH] DeprecationWarning invalid escape sequence fix
+
+Upstream-Status: Submitted [https://github.com/tikitu/jsmin/pull/38]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ jsmin/test.py | 22 +++++++++++-----------
+ 1 file changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/jsmin/test.py b/jsmin/test.py
+index 173ac65..afea4e7 100644
+--- a/jsmin/test.py
++++ b/jsmin/test.py
+@@ -337,8 +337,8 @@ def testImplicitSemicolon3(self):
+ self.assertMinified("return//comment...\r\na", "return\na")
+
+ def testSingleComment2(self):
+- self.assertMinified('x.replace(/\//, "_")// slash to underscore',
+- 'x.replace(/\//,"_")')
++ self.assertMinified('x.replace(/\\//, "_")// slash to underscore',
++ 'x.replace(/\\//,"_")')
+
+ def testSlashesNearComments(self):
+ original = '''
+@@ -383,8 +383,8 @@ def test_space_in_regex(self):
+ self.assertMinified(original, original)
+
+ def test_brackets_around_slashed_regex(self):
+- original = 'function a() { /\//.test("a") }'
+- expected = 'function a(){/\//.test("a")}'
++ original = 'function a() { /\\//.test("a") }'
++ expected = 'function a(){/\\//.test("a")}'
+ self.assertMinified(original, expected)
+
+ def test_angular_1(self):
+@@ -455,12 +455,12 @@ def testBackticksTagged(self):
+ def test_issue_bitbucket_16(self):
+ original = """
+ f = function() {
+- return /DataTree\/(.*)\//.exec(this._url)[1];
++ return /DataTree\\/(.*)\\//.exec(this._url)[1];
+ }
+ """
+ self.assertMinified(
+ original,
+- 'f=function(){return /DataTree\/(.*)\//.exec(this._url)[1];}')
++ 'f=function(){return /DataTree\\/(.*)\\//.exec(this._url)[1];}')
+
+ def test_issue_bitbucket_17(self):
+ original = "// hi\n/^(get|post|head|put)$/i.test('POST')"
+@@ -470,7 +470,7 @@ def test_issue_bitbucket_17(self):
+ def test_issue_6(self):
+ original = '''
+ respond.regex = {
+- comments: /\/\*[^*]*\*+([^/][^*]*\*+)*\//gi,
++ comments: /\\/\\*[^*]*\\*+([^/][^*]*\\*+)*\\//gi,
+ urls: 'whatever'
+ };
+ '''
+@@ -548,16 +548,16 @@ def test_issue_9_multi_comments(self):
+
+ def test_issue_12_re_nl_if(self):
+ original = '''
+- var re = /\d{4}/
++ var re = /\\d{4}/
+ if (1) { console.log(2); }'''
+ self.assertMinified(
+- original, 'var re=/\d{4}/\nif(1){console.log(2);}')
++ original, 'var re=/\\d{4}/\nif(1){console.log(2);}')
+
+ def test_issue_12_re_nl_other(self):
+ original = '''
+- var re = /\d{4}/
++ var re = /\\d{4}/
+ g = 10'''
+- self.assertMinified(original , 'var re=/\d{4}/\ng=10')
++ self.assertMinified(original , 'var re=/\\d{4}/\ng=10')
+
+ def test_preserve_copyright(self):
+ original = '''
diff --git a/meta-python/recipes-devtools/python/python3-jsmin/run-ptest b/meta-python/recipes-devtools/python/python3-jsmin/run-ptest
index cbcfffda5b..586608d7b2 100644
--- a/meta-python/recipes-devtools/python/python3-jsmin/run-ptest
+++ b/meta-python/recipes-devtools/python/python3-jsmin/run-ptest
@@ -1,3 +1,2 @@
#!/bin/sh
-
-python3 test.py
+pytest -vv test.py | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}'
diff --git a/meta-python/recipes-devtools/python/python3-jsmin_3.0.1.bb b/meta-python/recipes-devtools/python/python3-jsmin_3.0.1.bb
index 15c9b14595..c3129e7b53 100644
--- a/meta-python/recipes-devtools/python/python3-jsmin_3.0.1.bb
+++ b/meta-python/recipes-devtools/python/python3-jsmin_3.0.1.bb
@@ -10,6 +10,7 @@ SRC_URI[sha256sum] = "c0959a121ef94542e807a674142606f7e90214a2b3d1eb17300244bbb5
BBCLASSEXTEND = "native nativesdk"
SRC_URI += " \
+ file://7a75d76c2d6bfb917f30ced8f5c0a9a4157f7819.patch \
file://run-ptest \
"