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

[ Unit testing - simulation scope ] - import/export of a simulation (XLS) #2285

Open
EllynBsc opened this issue Jan 22, 2025 · 2 comments · May be fixed by #2218
Open

[ Unit testing - simulation scope ] - import/export of a simulation (XLS) #2285

EllynBsc opened this issue Jan 22, 2025 · 2 comments · May be fixed by #2218
Assignees
Labels
feature use for describing a new feature to develop

Comments

@EllynBsc
Copy link
Member

Write unit tests in the context of a simulation for:

-Export of a simulation (XLS). In that part a part of it was covered in #1489 (Only the central formatting method is covered, but not the components)
-Import of a simulation (XLS)

@EllynBsc EllynBsc added the feature use for describing a new feature to develop label Jan 22, 2025
@EllynBsc EllynBsc added this to the Release 1.13.0 milestone Jan 22, 2025
@antoinemzs
Copy link
Contributor

antoinemzs commented Jan 22, 2025

Relevant file (point of entry) for Import Injects into Simulation (XLS): openbas-api/src/main/java/io/openbas/rest/exercise/ExerciseImportApi.java

Note an XLS file with the intended importId as name should be uploaded to the server's tmp dir before the actual import is able to proceed.

Note also that the import function needs an ImportMapper instance in the database that matches the format of the individual lines in the XLS source.

Test cases (non exhaustive):

  • Input format not matching Matcher definition -> TBD
  • Mapper does not exist -> should throw
  • Exercise does not exist -> should throw
  • Input inject type has no applicable matcher -> message in summary
  • Input inject type has more than one applicable matcher -> message in summary
  • Contextual team does not exist
  • "Current user" does not exist -> should throw (is this possible that current user does not exist?)

Interesting behaviours to confirm:

  • All imported injects have a time delta for execution of 0 notwithstanding the time delta on the original objects
  • Lost of circling about with computing times and dates, check if possible to simplify (> 200 lines)

@antoinemzs antoinemzs linked a pull request Jan 22, 2025 that will close this issue
6 tasks
@antoinemzs antoinemzs linked a pull request Jan 22, 2025 that will close this issue
6 tasks
@antoinemzs
Copy link
Contributor

See #2218 for an attempt at testing actual components doing the XLS export

@EllynBsc EllynBsc self-assigned this Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature use for describing a new feature to develop
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants