{"id":18768487,"url":"https://github.com/pdevito3/testingserviceregistration","last_synced_at":"2025-12-10T04:30:13.525Z","repository":{"id":110877926,"uuid":"581411192","full_name":"pdevito3/TestingServiceRegistration","owner":"pdevito3","description":"Testing options for more flexible service registration in integration tests","archived":false,"fork":false,"pushed_at":"2022-12-23T13:32:57.000Z","size":256,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-29T07:16:48.067Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pdevito3.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-23T05:28:36.000Z","updated_at":"2022-12-23T05:28:54.000Z","dependencies_parsed_at":"2023-07-21T14:17:49.738Z","dependency_job_id":null,"html_url":"https://github.com/pdevito3/TestingServiceRegistration","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdevito3%2FTestingServiceRegistration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdevito3%2FTestingServiceRegistration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdevito3%2FTestingServiceRegistration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdevito3%2FTestingServiceRegistration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pdevito3","download_url":"https://codeload.github.com/pdevito3/TestingServiceRegistration/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239671416,"owners_count":19677873,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T19:12:55.049Z","updated_at":"2025-12-10T04:30:13.465Z","avatar_url":"https://github.com/pdevito3.png","language":"C#","readme":"# forTesting\n\nThis project was created with [Craftsman](https://github.com/pdevito3/craftsman).\n\n## Getting Started\n1. Run `docker-compose up --build` from your `.sln` directory to spin up your database(s) and other supporting \ninfrastructure depending on your configuration (e.g. RabbitMQ, Keycloak, Jaeger, etc.).\n2. Apply migrations\n    1. Make sure you have a migrations in your boundary project (there should be a `Migrations` directory in the project directory). \n    If there isn't see [Running Migrations](#running-migrations) below.\n    2. Confirm your environment (`ASPNETCORE_ENVIRONMENT`) is set to `Development` using \n    `$Env:ASPNETCORE_ENVIRONMENT = \"Development\"` for powershell or `export ASPNETCORE_ENVIRONMENT=Development` for bash.\n    3. `cd` to the boundary project root (e.g. `cd RecipeManagement/src/RecipeManagement`)\n    4. Run your project and your migrations should be applied automatically. Alternatively, you can run `dotnet ef database update` to apply your migrations manually.\n\n    \u003e You can also stay in the `sln` root and run something like `dotnet ef database update --project RecipeManagement/src/RecipeManagement`\n3. If using a Keycloak auth server, you'll need to configure it manually (new realm, client, etc) or use the scaffolded Pulumi setup.\n    1. [Install the pulumi CLI](https://www.pulumi.com/docs/get-started/) \n    1. `cd` to your scaffolded Pulumi project\n    1. Run `pulumi up` to start the scaffolding process\n    1. Create a new stack by pressing `Enter` when prompted and then typing the name of the stack (e.g. `dev`). Alternatively\n    you can use the `pulumi stack init` command to make a new stack first.\n        \u003e Note: The stack name must match the extension on your yaml config file (e.g. `Pulumi.dev.yaml`) would have a stack of `dev`.\n    1. Select yes to apply the configuration to your local Keycloak instance.\n4. If running a BFF:\n    1. Make sure you have [`yarn` installed](https://yarnpkg.com/getting-started/install)\n    1. Run the project with `dotnet run` or your IDE\n\n### Running Your Project(s)\nOnce you have your database(s) running, you can run your API(s), BFF, and Auth Servers by using \nthe `dotnet run` command or running your project(s) from your IDE of choice.   \n\n## Running Integration Tests\nTo run integration tests:\n\n1. Ensure that you have docker installed.\n2. Go to your src directory for the bounded context that you want to test.\n3. Confirm that you have migrations in your infrastructure project. If you need to add them, see the [instructions below](#running-migrations).\n4. Run the tests\n\n\u003e ⏳ If you don't have the database image pulled down to your machine, they will take some time on the first run.\n\n### Troubleshooting\n- If your entity has foreign keys, you might need to adjust some of your tests after scaffolding to accomodate them.\n\n## Running Migrations\nTo create a new migration, make sure your environment is set to `Development`:\n\n### Powershell\n```powershell\n$Env:ASPNETCORE_ENVIRONMENT = \"Development\"\n```\n\n### Bash\n```bash\nexport ASPNETCORE_ENVIRONMENT=Development\n```\n\nThen run the following:\n\n```shell\ncd YourBoundedContextName/src/YourBoundedContextName\ndotnet ef migrations add \"MigrationDescription\"\n```\n\nTo apply your migrations to your local db, make sure your database is running in docker run the following:\n\n```bash\ncd YourBoundedContextName/src/YourBoundedContextName\ndotnet ef database update\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpdevito3%2Ftestingserviceregistration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpdevito3%2Ftestingserviceregistration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpdevito3%2Ftestingserviceregistration/lists"}