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

Improve code coverage #23

Open
9 tasks done
stv0g opened this issue Sep 10, 2019 · 14 comments
Open
9 tasks done

Improve code coverage #23

stv0g opened this issue Sep 10, 2019 · 14 comments

Comments

@stv0g
Copy link
Contributor

stv0g commented Sep 10, 2019

In GitLab by @skolen on Sep 10, 2019, 16:49

The code coverage of tests should be improved as much as reasonable for the following packages

  • database
  • routes/dashboard
  • routes/file
  • routes/scenario
  • routes/signal
  • routes/simulationmodel
  • routes/simulator
  • routes/user
  • routes/widget

Especially the testing of error return codes has to be improved. However, testing for a 500 (internal server error) return code due to a database failure will be difficult.

@stv0g
Copy link
Contributor Author

stv0g commented Sep 12, 2019

In GitLab by @skolen on Sep 12, 2019, 10:28

marked the checklist item database as completed

@stv0g
Copy link
Contributor Author

stv0g commented Sep 12, 2019

In GitLab by @skolen on Sep 12, 2019, 10:28

marked the checklist item routes/dashboard as completed

@stv0g
Copy link
Contributor Author

stv0g commented Sep 12, 2019

In GitLab by @skolen on Sep 12, 2019, 10:28

marked the checklist item routes/file as completed

@stv0g
Copy link
Contributor Author

stv0g commented Sep 12, 2019

In GitLab by @skolen on Sep 12, 2019, 10:28

marked the checklist item routes/scenario as completed

@stv0g
Copy link
Contributor Author

stv0g commented Sep 12, 2019

In GitLab by @skolen on Sep 12, 2019, 10:28

marked the checklist item routes/signal as completed

@stv0g
Copy link
Contributor Author

stv0g commented Sep 12, 2019

In GitLab by @skolen on Sep 12, 2019, 10:28

marked the checklist item routes/simulationmodel as completed

@stv0g
Copy link
Contributor Author

stv0g commented Sep 12, 2019

In GitLab by @skolen on Sep 12, 2019, 10:28

marked the checklist item routes/simulator as completed

@stv0g
Copy link
Contributor Author

stv0g commented Sep 12, 2019

In GitLab by @skolen on Sep 12, 2019, 10:28

marked the checklist item routes/widget as completed

@stv0g
Copy link
Contributor Author

stv0g commented Oct 7, 2019

In GitLab by @skolen on Oct 7, 2019, 13:33

marked the checklist item routes/user as completed

@stv0g
Copy link
Contributor Author

stv0g commented Nov 5, 2019

In GitLab by @skolen on Nov 5, 2019, 12:09

Done.

@stv0g
Copy link
Contributor Author

stv0g commented Nov 5, 2019

In GitLab by @skolen on Nov 5, 2019, 12:09

closed

@stv0g
Copy link
Contributor Author

stv0g commented Oct 26, 2021

In GitLab by @skolen on Oct 26, 2021, 11:01

We should look at the code coverage of our go-test again. There is plenty of new code, threads and config options to be tested.

@stv0g
Copy link
Contributor Author

stv0g commented Nov 3, 2021

In GitLab by @skolen on Nov 3, 2021, 15:28

Here is a summary of the packages and methods for which code coverage in our go tests should be improved. Improvements mostly relate to testing the error cases for the expected response. In some cases, new or revised tests are required because we have added new functionality or moved functionality between packages.

database

  • admin: (not tested at the moment)
    • AddAdminUser
    • generatePassword
    • AddTestUsers
  • database: InitDB
  • permissions (not explicitly tested at the moment - only implicitly through the routes packages)
  • roles: ValidateRole (not explicitly tested at the moment - only implicitly through the routes packages)

component-configuration

  • endpoints: updateConfig
  • methods:
    • ByID (not sure if we still need this method)
    • addToScenario
    • Update
    • delete

dashboard

  • endpoints: updateDashboard
  • methods:
    • ByID (not sure if we still need this method)
    • addToScenario
    • delete
  • validators: updatedDashboard

file

  • endpoints: getFile
  • methods:
    • ByID (not sure if we still need this method)
    • download
    • Register
    • update
    • Delete
  • s3: we have to make sure that our tests cover both codes, the one for files in the PostgreSQL DB and the one for files in s3 object storage. Our CI tests both cases in separate test runs at the moment. This is not ideal.

infrastructure-component

  • amqpmethods:
    • ProcessMessage
    • createExternalIC
    • updateExternalIC
    • SendPing
    • sendActionAMQP
  • apiquery (not tested at the moment)
    • QueryICAPIs
    • queryIC
    • queryVillasNodeGateway
    • queryVillasRelayGateway
  • endpoints
    • addIC
    • updateIC
    • deleteIC
    • sendActionToIC
  • methods
    • ById (not sure if we still need this method)
    • update
  • validators: both validate methods

result

  • endpoints:
    • updateResult
    • deleteResult
    • addResultFile
    • deleteResultFile
  • methods:
    • ById (not sure if we still need this method)
    • addToScenario
    • delete
    • removeResultFileID

scenario

  • endpoints
    • getScenarios
    • addScenario
    • deleteScenario
    • getUsersOfScenario
    • addUserToScenario
  • methods
    • ByID (not sure if we still need this method)
    • update
    • deleteUser
    • delete

signal

  • endpoints: updateSignal
  • methods:
    • AddToConfig
    • delete
  • validators: updatedSignal

user

  • authenticate endpoints:
    • authenticated (not tested at the moment)
    • authenticate
    • authenticateInternal
    • authenticateExternal (not tested at the moment)
    • isAlreadyDuplicated (not tested at the moment)
  • scenario duplication:
    • duplicateScenarioForUser
    • duplicateScenario
    • duplicateFile
    • duplicateComponentConfig
    • duplicateDashboard
    • duplicateWidget
    • duplicateIC
  • methods:
    • NewUser
    • setPassword
    • update
  • middleware:
    • claimsToContext
    • isAuthenticated
    • Authentication

widget

  • endpoints: updateWidget
  • methods:
    • ByID (not sure if we still need this method)
    • addToDashboard
    • delete

@stv0g
Copy link
Contributor Author

stv0g commented Apr 25, 2022

In GitLab by @skolen on Apr 25, 2022, 15:51

unassigned @skolen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant