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

test: adding an integration test for the account deletion feature #8723

Merged
merged 54 commits into from
Aug 31, 2023

Conversation

albatrousse
Copy link
Contributor

adding a test for the user deletion feature in which :

  • a common user is created
  • the user adds a product then deletes his account
  • an admin user is created and checks if the user account is well deleted (checking the edit preferences page and contributor page)
  • the admin also checks if the product added by the user is anonymized (the product should display "anonymous" as creator)
  • checking that no one can log in with the user logs

currently working on assigning the deletion account part to a minion job and waiting it to be done before having an admin to check whether the account is well deleted or not

adding a test for the user deletion feature in which :

a common user is created
the user adds a product then deletes his account
an admin user is created and checks if the user account is well deleted (checking the edit preferences page and contributor page)
the admin also checks if the product added by the user is anonymized (the product should display "anonymous" as creator)
checking that no one can log in with the user logs
@codecov-commenter
Copy link

codecov-commenter commented Jul 24, 2023

Codecov Report

Merging #8723 (3ab53f7) into main (d3304c1) will increase coverage by 0.04%.
The diff coverage is 72.72%.

@@            Coverage Diff             @@
##             main    #8723      +/-   ##
==========================================
+ Coverage   45.54%   45.58%   +0.04%     
==========================================
  Files          64       64              
  Lines       19519    19549      +30     
  Branches     4738     4743       +5     
==========================================
+ Hits         8889     8912      +23     
- Misses       9454     9457       +3     
- Partials     1176     1180       +4     
Files Changed Coverage Δ
lib/ProductOpener/Producers.pm 51.92% <55.55%> (+0.22%) ⬆️
lib/ProductOpener/APITest.pm 74.07% <79.16%> (+0.43%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@albatrousse albatrousse changed the title test: [WIP] adding an integration test for the account deletion feature test: adding an integration test for the account deletion feature Jul 27, 2023
Copy link
Member

@alexgarel alexgarel left a comment

Choose a reason for hiding this comment

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

Really good work, now let's improve a bit :-)

tests/integration/delete_user.t Outdated Show resolved Hide resolved
tests/integration/delete_user.t Outdated Show resolved Hide resolved
tests/integration/delete_user.t Outdated Show resolved Hide resolved
tests/integration/delete_user.t Outdated Show resolved Hide resolved
@albatrousse
Copy link
Contributor Author

Thank you for your review @alexgarel, I'll work on the changes that have to be made

@albatrousse
Copy link
Contributor Author

I'm now working on writing a subprogram in the module APITest.pm which will essentially do the waiting part of the delete user task of my program

@albatrousse
Copy link
Contributor Author

I'm going to push my code with the troublesome issue I've been dealing with for the past few days.
If you write use ProductOpener::Producers qw/:all/ in APITest.pm in order to import the module that contains the variable $minion, you will end up getting Error 137 whatever integration test you run.
Does someone have an idea on why ?

@albatrousse albatrousse changed the title test: adding an integration test for the account deletion feature test: [need help] adding an integration test for the account deletion feature Aug 2, 2023
lib/ProductOpener/APITest.pm Show resolved Hide resolved
lib/ProductOpener/APITest.pm Outdated Show resolved Hide resolved
lib/ProductOpener/APITest.pm Show resolved Hide resolved
lib/ProductOpener/APITest.pm Outdated Show resolved Hide resolved
Copy link
Member

@alexgarel alexgarel left a comment

Choose a reason for hiding this comment

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

I made a small commit just to ensure consistency in get_minion_jobs.

Thank you @albatrousse !

@alexgarel alexgarel enabled auto-merge (squash) August 31, 2023 14:08
@sonarcloud
Copy link

sonarcloud bot commented Aug 31, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@alexgarel alexgarel merged commit 33602a8 into main Aug 31, 2023
13 checks passed
@alexgarel alexgarel deleted the albatrousse_delete_user_test branch August 31, 2023 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Account deletion Enabling users to delete account while preserving accountability for edits 🪶 Apache We use Apache as a server to run Open Food Facts file import 🏭 Producers Platform https://wiki.openfoodfacts.org/Platform_for_producers 🧪 tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants