(
store: &mut PostgresStore<Client>,
)
| 275 | } |
| 276 | |
| 277 | async fn seed_data( |
| 278 | store: &mut PostgresStore<Client>, |
| 279 | ) -> Result<SeededEntities, Report<SetupError>> { |
| 280 | let system_account_id: MachineId = store |
| 281 | .get_or_create_system_machine("h") |
| 282 | .await |
| 283 | .change_context(SetupError::Seed) |
| 284 | .attach("could not create system machine")?; |
| 285 | let user_id = store |
| 286 | .create_user_actor( |
| 287 | system_account_id.into(), |
| 288 | CreateUserActorParams { |
| 289 | user_id: None, |
| 290 | shortname: Some("orchestrator-test".to_owned()), |
| 291 | registration_complete: true, |
| 292 | }, |
| 293 | ) |
| 294 | .await |
| 295 | .change_context(SetupError::Seed) |
| 296 | .attach("could not create test user")? |
| 297 | .user_id; |
| 298 | |
| 299 | let actor_id: ActorEntityUuid = user_id.into(); |
| 300 | let web_id: WebId = user_id.into(); |
| 301 | let ownership = OntologyOwnership::Local { web_id }; |
| 302 | |
| 303 | seed_ontology(store, actor_id, &ownership).await?; |
| 304 | |
| 305 | let alice = create_entity( |
| 306 | store, |
| 307 | actor_id, |
| 308 | web_id, |
| 309 | entity_type::PERSON_V1, |
| 310 | entity::PERSON_ALICE_V1, |
| 311 | false, |
| 312 | ) |
| 313 | .await?; |
| 314 | |
| 315 | let bob = create_entity( |
| 316 | store, |
| 317 | actor_id, |
| 318 | web_id, |
| 319 | entity_type::PERSON_V1, |
| 320 | entity::PERSON_BOB_V1, |
| 321 | false, |
| 322 | ) |
| 323 | .await?; |
| 324 | |
| 325 | let organization = create_entity( |
| 326 | store, |
| 327 | actor_id, |
| 328 | web_id, |
| 329 | entity_type::ORGANIZATION_V1, |
| 330 | entity::ORGANIZATION_V1, |
| 331 | false, |
| 332 | ) |
| 333 | .await?; |
| 334 |
no test coverage detected