altinn-studio icon indicating copy to clipboard operation
altinn-studio copied to clipboard

Add more test users and support for subscribing to events in localtest

Open RonnyB71 opened this issue 2 years ago • 6 comments

Description

Related Issue(s)

  • #8969

Verification

  • [ ] Your code builds clean without any errors or warnings
  • [ ] Manual testing done (required)
  • [ ] Relevant automated test added (if you find this hard, leave it and we'll help out)
  • [ ] All tests run green

Documentation

  • [ ] User documentation is updated with a separate linked PR in altinn-studio-docs. (if applicable)

RonnyB71 avatar Oct 13 '22 11:10 RonnyB71

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
0.0% 0.0% Duplication

sonarqubecloud[bot] avatar Oct 13 '22 11:10 sonarqubecloud[bot]

@SandGrainOne @acn-sbuad This is a "collection" of changes required to run the DIHE application locally.

  • I've added a dead simple implementation of subscription endpoint in Events just to be able call it locally - something we can live with or would you like to see a more implemented?
  • I've included the test users used in the DIHE solution and extended the two we have - do we see any issues with this?
  • I've also added Json Propertynames on eFormidling as this was missing and the deserialization didn't work

RonnyB71 avatar Oct 13 '22 11:10 RonnyB71

Is the correct approach to just add more and more users in localtest?

This is a requirement for most apps that use apis based on user information, and adding users doesn't seem very scalable. How about we instead let LocalTest fetch additional registry data from the running app? (just as we now fetch policy.xml for authorization). It would be a new API, but Ola Nordmann and Sofie Salt would still work for old apps, and only LocalTest will use the api, so it is safe to deploy the api to production.

ivarne avatar Oct 14 '22 06:10 ivarne

This is a requirement for most apps that use apis based on user information, and adding users doesn't seem very scalable. How about we instead let LocalTest fetch additional registry data from the running app? (just as we now fetch policy.xml for authorization).

I don't quite understand what you mean. Where would the app get the user data?

SandGrainOne avatar Oct 14 '22 06:10 SandGrainOne

I don't quite understand what you mean. Where would the app get the user data?

Just a few json files in a folder named TestRegistry in the app repo. I assume the app developers knows what kind of users they want to use in testing.

ivarne avatar Oct 14 '22 06:10 ivarne

@ivarne @SandGrainOne regarding adding more and more test users in localtest. I agree that this probably isn't the way forward as it would be a global set of test data to support every app's specific user needs (roles etc.). I think we should re-think the test user strategy and for example look at https://www.skatteetaten.no/en/forms/tenor-test-data/ and perhaps avoid managing test users on our side all together. Either way it's a bigger issue than I have time for right now, but I'll create a new issue (if we don't have one) to deal with it.

RonnyB71 avatar Oct 17 '22 09:10 RonnyB71