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 suite for the occurrence import mechanism #40

Closed
niconoe opened this issue Oct 4, 2021 · 4 comments
Closed

Test suite for the occurrence import mechanism #40

niconoe opened this issue Oct 4, 2021 · 4 comments
Assignees
Labels
enhancement New feature or request in progress

Comments

@niconoe
Copy link
Member

niconoe commented Oct 4, 2021

This would be useful since it's an important/central part of the tool, and it's probably getting slowly more complex over time.

@niconoe niconoe added the enhancement New feature or request label Oct 4, 2021
@niconoe niconoe self-assigned this Oct 4, 2021
@niconoe
Copy link
Member Author

niconoe commented Nov 10, 2021

Update: I implemented the --source-dwca option (will make the script more flexible but also make testing a bit easier).

Things be be tested (to be refined):

  • that we can import an existing file with --source-dwca
  • that a correct request is sent to GBIF if we're not using the --source-dwca option
  • that the maintenance mode is correctly set and released (blocked by Data import: maintenance mode during data update #22)
  • basic import works: correct number of occurrences
  • basic import works: correct values for the occurrence records
  • basic import works: a new DataImport is created
  • basic import works: DataImport values are correct
  • previous occurrences (replaced or not!) are deleted
  • that some filtering is applied (absence records, no date, no location, ...)
  • that entities linked to occurrences are properly moved to the new occurrence
  • atomicity (see Make occurrence import process atomic #62)
  • emails are sent reporting the status
  • raw values (strings) are trimmed
  • ...

@damianooldoni
Copy link
Collaborator

damianooldoni commented Nov 10, 2021

Nice to see this @niconoe! 🥳
About filtering, I think it's better to filter as much as possible in the query and that only tests are performed from our side. This will make things easier to be reviewed also (if we doubt which data we used months ago, checking the download webpage will be easier). Or am I missing something?

@niconoe
Copy link
Member Author

niconoe commented Nov 10, 2021

Thanks @damianooldoni, very good point.

I can't guarantee that there will always be a GBIF filter available to suit our needs (in that case, we'll also need to keep a lighter filtering stage at import stage), but indeed the better approach is to filter as much as possible at the "generate download" step. I'll create a new issue to focus on this point (this one is primarily for the unit tests of the import mechanism).

@niconoe niconoe changed the title Test suite for the data import mechanism Test suite for the occurrence import mechanism Dec 9, 2021
@niconoe
Copy link
Member Author

niconoe commented Oct 2, 2023

I think all was covered a long time ago.

@niconoe niconoe closed this as completed Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request in progress
Projects
None yet
Development

No branches or pull requests

2 participants