[FOLIO-3122] Add a new test tenant in ephemeral properties for edge-orders Created: 19/Apr/21  Updated: 21/May/21  Resolved: 05/May/21

Status: Closed
Project: FOLIO
Components: None
Affects versions: None
Fix versions: None

Type: Task Priority: P3
Reporter: Damien Assignee: Wayne Schneider
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original estimate: Not Specified

Issue links:
Gantt End to End
has to be finished together with EDGORDERS-6 End-to-end tests Closed
Relates
relates to FOLIO-3170 folio/snapshot Vagrant box build fail... Closed
relates to FOLIO-2647 Add a new test tenant in ephemeral pr... Closed
Sprint: DevOps Sprint 113
Development Team: FOLIO DevOps
Tester Assignee: Damien

 Description   

Purpose/Overview:

Karate integration tests normally use random names for tenants to avoid collisions. For edge modules, tests rely on authentication specified in ephemeral.properties which cannot be random. We can still limit risks of collisions by using separate test tenants for each edge module, and avoid using diku or diku_admin.

For edge-orders, we would need the following changes to ephemeral.properties:

  • replace "tenants={{ tenant }},test_oaipmh" by "tenants={{ tenant }},test_oaipmh,test_edge_orders"
  • add the following line at the end: "test_edge_orders=test-user,test"

Note: another way to do this would be to define 10 or more tenants with a number at the end and let tests pick one randomly. This way we would not have to keep adding new tenants in this file for new edge modules, and it would still reduce the risk of collisions. AFAIK test_oaipmh is not currently used in mod-oai-pmh's integration tests.



 Comments   
Comment by Wayne Schneider [ 28/Apr/21 ]

Damien just to be clear – are these assumptions correct?

  • The tenants and users ONLY need to be defined in the edge module configuration file, they don't actually need to be created in FOLIO on the reference environment
  • Every edge tenant defined for testing should have the username test-user and the password test
Comment by Wayne Schneider [ 28/Apr/21 ]

Which environments are tested using the Karate integration tests – the AWS reference environment daily builds (e.g. folio-snapshot, folio-testing, etc.)? The Vagrant boxes? Or some other environment that is built using folio-ansible?

Comment by Damien [ 29/Apr/21 ]

These tests can be executed in the reference environment (folio-snapshot and folio-testing), in the Vagrant boxes, and FOLIO CI with an "ec2-" dns name (I don't know much about the last one but I see it in the config file).

Tenants and users only need to be defined in the edge module configuration (the tests create them dynamically in FOLIO).

With the latest PR edge-orders is using a tenant named "test_edge_orders" with a user named "test-user" and the password "test". Other modules would use other tenants/users.

Comment by Victoria_Smelova [ 04/May/21 ]

Wayne Schneider please, let us know if any other info is required from Thunderjet's side.
It would be really great to get it resolved by the end of week, so that Thunderjet's task can be closed within the current sprint.
(cc Jakub Skoczen)

Comment by Wayne Schneider [ 04/May/21 ]

Former user Damien thanks, I think we have the information we need.

Comment by Wayne Schneider [ 04/May/21 ]

Damien this has been set up as requested and should be available in the next builds of folio-testing, folio-snapshot, and the Vagrant boxes. Let me know if it's working for you or if you need any changes. Thanks!

Comment by Damien [ 04/May/21 ]

Wayne Schneider It does not work, but I am not sure why. It looks like the testing environment was updated (although https://folio-testing.dev.folio.org/ does not seem to work well).

Testing is using the following calls to create the tenant and user and try to connect to edge-orders:

POST https://folio-testing-okapi.dev.folio.org:443/_/proxy/tenants

{ "id": "test_edge_orders", "name": "Test tenant", "description": "Tenant for test purpose" }

POST https://folio-testing-okapi.dev.folio.org:443/users
{
"id": "00000000-1111-5555-9999-999999999992",
"username": "test-user",
"active": true,
"personal":

{ "firstName": "Admin", "lastName": "Orders API Tests" }

}

these are successful, but: 
GET https://folio-testing.dev.folio.org:8000/orders/validate?type=EBSCONET&apiKey=eyJzIjoia1FoWUtGYzFJMFE5bVhKNmRUWU0iLCJ0IjoidGVzdF9lZGdlX29yZGVycyIsInUiOiJ0ZXN0LXVzZXIifQ%3D%3D
fails with:
{
"Error":

{ "Code": "ACCESS_DENIED", "Message": "Access Denied" }

}

(this is the same error as for a random tenant/user)

Are the URLs correct for creating the tenant and user, and to use edge-orders ?
It works when I use an apiKey with diku/diku, like "eyJzIjoiNXNlNGdnbXk1TiIsInQiOiJkaWt1IiwidSI6ImRpa3UifQ==".

Comment by Wayne Schneider [ 04/May/21 ]

Sorry for the confusion, Damien – please try again tomorrow when the folio-testing and folio-snapshot environments will have been refreshed. They were not rebuilt today.

Comment by David Crossley [ 04/May/21 ]

Damien The daily build times are noted here: https://dev.folio.org/guides/automation/#reference-environments

Comment by Damien [ 05/May/21 ]

Wayne Schneider David Crossley Thanks, I was confused about the build times. I just tried it, and it works. This ticket can be closed.

Generated at Thu Feb 08 23:25:47 UTC 2024 using Jira 1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d.