Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: warnings in producers tests #11190

Merged
merged 2 commits into from
Jan 8, 2025
Merged

Conversation

benbenben2
Copy link
Collaborator

What

Error 2

https://github.com/openfoodfacts/openfoodfacts-server/actions/runs/7462755789/job/20306470532?pr=9288#step:4:15260
warning: GS1Parser error {error => bless( {message => "No GS1 DL keys found in path info",previous_exception => ""}, 'GS1::SyntaxEngine::FFI::EncoderParameterException' )}
warning: GS1Parser error {error => bless( {message => "No GS1 DL keys found in path info",previous_exception => ""}, 'GS1::SyntaxEngine::FFI::EncoderParameterException' )}
tests/unit/products.t ......................... ok

I commented this warning. It can be used for future devs.

However, there were additional warnings in the code because is() expected a single comparison and not an array.
After fixing this, it showed that some tests were not passing. I fixed them all (see reworks in Products.pm) but could be good if someone with GS1 knowledge could review it.

Ping @hangy because I noticed that you worked on this part of the code and GS1::SyntaxEngine::FFI::GS1Encoder

Related issue(s) and discussion

@benbenben2 benbenben2 self-assigned this Jan 5, 2025
@benbenben2 benbenben2 requested a review from a team as a code owner January 5, 2025 20:44
@codecov-commenter
Copy link

codecov-commenter commented Jan 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 49.22%. Comparing base (bf82a79) to head (e21196a).
Report is 10 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11190      +/-   ##
==========================================
- Coverage   49.25%   49.22%   -0.04%     
==========================================
  Files          78       78              
  Lines       22371    22405      +34     
  Branches     5365     5374       +9     
==========================================
+ Hits        11019    11028       +9     
- Misses       9996    10020      +24     
- Partials     1356     1357       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

stephanegigandet pushed a commit that referenced this pull request Jan 6, 2025
### What


```
Error 3

https://github.com/openfoodfacts/openfoodfacts-server/actions/runs/7462755789/job/20306470532?pr=9288#step:4:560
Name "FFI::Platypus::keep" used only once: possible typo at /usr/lib/x86_64-linux-gnu/perl-base/XSLoader.pm line 111.
error: ecoscore origin does not exist in taxonomy {origin => "IW",origin_id => "en:IW"}
error: ecoscore origin does not exist in taxonomy {origin => "SW",origin_id => "en:SW"}
error: ecoscore origin does not exist in taxonomy {origin => "US-AL",origin_id => "en:US-AL"}
error: ecoscore origin does not exist in taxonomy {origin => "US-GA",origin_id => "en:US-GA"}
error: ecoscore origin does not exist in taxonomy {origin => "US-LA",origin_id => "en:US-LA"}
error: ecoscore origin does not exist in taxonomy {origin => "US-MS",origin_id => "en:US-MS"}
error: ecoscore origin does not exist in taxonomy {origin => "US-SC",origin_id => "en:US-SC"}
error: ecoscore origin does not exist in taxonomy {origin => "US-TX",origin_id => "en:US-TX"}
error: ecoscore origin does not exist in taxonomy {origin => "WO",origin_id => "en:WO"}
error: ecoscore origin does not exist in taxonomy {origin => "Eaux internationales",origin_id => "fr:Eaux internationales"}
error: ecoscore origin does not exist in taxonomy {origin => "S\x{e3}o Tom\x{e9} e Pr\x{ed}ncipe",origin_id => "fr:S\x{e3}o Tom\x{e9} e Pr\x{ed}ncipe"}
error: ecoscore origin does not exist in taxonomy {origin => "Territoires fran\x{e7}ais du Sud",origin_id => "fr:Territoires fran\x{e7}ais du Sud"}
Use of uninitialized value $_[0] in substitution (s///) at tests/unit/attributes.t line 221.
```

Added in the taxonomies

### Related issue(s) and discussion
- Fixes #9655 (together with #11189 and #11190)
Copy link
Member

@hangy hangy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the newly failing tests in api_v3_product_read.t may need to be reviewed 🤔

@teolemon teolemon added GS1 The producer platform is integrating with the GS1 product data formats. GS1 manages barcodes. 🏭 Producers Platform - data imports labels Jan 7, 2025
@stephanegigandet
Copy link
Contributor

It looks like the newly failing tests in api_v3_product_read.t may need to be reviewed 🤔

@hangy I think the changes in results of api_v3_product_read.t are good changes, consistent with the normalization we do (remove leading 0s, so EAN14 with a leading 0 becomes EAN13).

@stephanegigandet
Copy link
Contributor

/update_tests_results

Copy link

sonarqubecloud bot commented Jan 7, 2025

Copy link
Member

@hangy hangy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you! :)

Copy link
Contributor

@stephanegigandet stephanegigandet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @benbenben2 !

@stephanegigandet stephanegigandet merged commit 0588976 into main Jan 8, 2025
14 checks passed
@stephanegigandet stephanegigandet deleted the fix/warning_producers_tests branch January 8, 2025 18:22
alexgarel added a commit that referenced this pull request Jan 10, 2025
🤖 I have created a release *beep* *boop*
---


##
[2.54.0](v2.53.0...v2.54.0)
(2025-01-10)


### Features

* gzip js, css, SVG icons assets
([#11208](#11208))
([c0a5275](c0a5275))


### Bug Fixes

* "NutriScore V2" SVGs with blank space
([#11218](#11218))
([38d79e8](38d79e8))
* avoid crash in display_orgs_table when org.created_t is not set, fix
permission
([#11203](#11203))
([765d796](765d796))
* greenscore attribute with old ecoscore_data
([#11212](#11212))
([4f596ad](4f596ad))
* Invalid OFF dark icon
([#11206](#11206))
([f63daa8](f63daa8))
* Nutripatrol url trailing slash removal regex
([#11204](#11204))
([f42f8dd](f42f8dd))
* Nutriscore for fresh herbs
([#11112](#11112))
([cdd7cf5](cdd7cf5))
* Remove irrelevant things in Config_obf.pm
([c5d448d](c5d448d))
* Remove irrelevant things in the Open Beauty Facts config
([#11195](#11195))
([c5d448d](c5d448d))
* remove warning in Display.pm related to Environmental Scoring
([#11172](#11172))
([176fe9e](176fe9e))
* Removing irrelevant fields in the Open Products Facts config
([4583ed2](4583ed2))
* Removing irrelevant fields in the Open Products Facts config
([#11202](#11202))
([4583ed2](4583ed2))
* typo in ecoscore redirect
([#11213](#11213))
([85fd575](85fd575))
* use ecoscore data when greenscore not available
([#11197](#11197))
([5ae1273](5ae1273))
* warnings in producers tests
([#11190](#11190))
([0588976](0588976))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: Alex Garel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧽 Data quality https://wiki.openfoodfacts.org/Quality GS1 The producer platform is integrating with the GS1 product data formats. GS1 manages barcodes. 🏭 Producers Platform - data imports Products 🧪 tests 🧪 unit tests
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants