{"id":16542281,"url":"https://github.com/brantburnett/couchbase-functional-testing","last_synced_at":"2026-05-12T09:34:26.806Z","repository":{"id":66704279,"uuid":"296903085","full_name":"brantburnett/couchbase-functional-testing","owner":"brantburnett","description":"An example for supporting both local machine development and continuous integration testing using containerized instances of Couchbase","archived":false,"fork":false,"pushed_at":"2020-09-24T01:49:24.000Z","size":40,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-14T10:18:25.868Z","etag":null,"topics":["continuous-integration","couchbase","couchbase-server","docker"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brantburnett.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2020-09-19T15:59:27.000Z","updated_at":"2020-09-24T01:49:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"6d49af89-694c-4bd9-814e-00ce99e5a52f","html_url":"https://github.com/brantburnett/couchbase-functional-testing","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/brantburnett%2Fcouchbase-functional-testing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brantburnett%2Fcouchbase-functional-testing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brantburnett%2Fcouchbase-functional-testing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brantburnett%2Fcouchbase-functional-testing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brantburnett","download_url":"https://codeload.github.com/brantburnett/couchbase-functional-testing/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241794136,"owners_count":20021192,"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":["continuous-integration","couchbase","couchbase-server","docker"],"created_at":"2024-10-11T18:57:05.359Z","updated_at":"2026-05-12T09:34:21.761Z","avatar_url":"https://github.com/brantburnett.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Couchbase Functional Testing\n\nThis repository contains an example for supporting both local machine development and\ncontinuous integration testing using containerized instances of Couchbase. The application\nis written in C# using .NET Core. The functional tests are written using NodeJS and Typescript.\nHowever, this pattern could be applied to any\n\n## Prerequisites\n\n- [Docker](https://www.docker.com/)\n- [Visual Studio Code](https://code.visualstudio.com/) (not required, but makes some steps easier)\n- [Docker extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker)\n\n\u003e :info: This approach may also be applied to Visual Studio using docker-compose projects. In fact, the rebuild/debug cycle\n\u003e for local development is more efficient in Visual Studio. However, Visual Studio Code was chosen for this example because\n\u003e it's free, cross-platform, and cross-language, and therefore reaches a broader audience. Porting the docker-compose files\n\u003e from this example to a Visual Studio style docker-compose project is a relatively straightforward process.\n\n## Configuring Couchbase\n\nThe Couchbase instance launched in a container is configured via files in the `couchbase` directory. For more details,\nsee the [readme file](./couchbase/README.md).\n\n## Local Machine Development\n\nTo run the application in VSCode, under `Terminal | Run Task...` run the `docker-compose up: debug` task. This will\nlaunch and configure Couchbase and launch the application. If this is the first run, be patient. Downloading, building, and\nstarting the containers may take some time on the first run.\n\nWhen you see `Application started. Press Ctrl+C to shut down.` in the terminal, the application is running. Open `http://localhost:8080/customers`\nin your browser or Postman to see the first 100 customers alphabetically.\n\nTo restart/rebuild the application, press Ctrl+C to stop the containers. Once stopped, you can launch again using the same process.\n\n### Debugging\n\nTo debug the application, press F5 to start the debugger. When prompted, select the `appundertest` container to attach. It is now\npossible to set breakpoints in the application found in the `AppUnderTest` folder.\n\n### Starting from Scratch\n\nEach time you launch the application using the `up` task, Couchbase is simply restarted with it's previous configuration and data.\nThis makes startup times much faster. If it's necessary to rebuild (for example, if you change configuration in the `couchbase` directory),\nrun the `docker-compose down: debug` task. This will clean up all related volumes so the next launch is clean.\n\n## Functional Tests\n\nFunctional tests, which may be run as part of a CI pipeline, confirm that the application starts and the API behaves as expected in\nan isolated test environment.\n\n### Running CI Tests Locally\n\nTo run the CI tests locally in VSCode, under `Terminal | Run Task...` run the `docker-compose up: test` task.\n\nAlternatively, the tests can be run from the command line. See detailed documentation in the [tests directory](./tests/README.md).\n\n### Debugging Tests\n\nTo debug the tests, first be sure that you've launched the application using the `docker-compose up: debug` task.\nThen launch the \"Debug Tests\" launch configuration. This runs the test with debugging enabled without containerization,\nallowing breakpoints to be set within the tests.\n\n## Key Points of Interest\n\nIt probably isn't possible to simply use this repository as a template for an application, instead parts of this repository\nmust be chosen and applied to other applications. Here are the key points of interest to examine when chosing the pieces.\n\n1. The `couchbase` directory, which defines how Couchbase is configured on startup for both local development and CI tests.\n2. The `docker-compose.yml` file, which defines how Couchbase and the application are started for both local development and CI tests.\n3. `AppUnderTest/Startup.cs`, which adds an optional loop to wait for Couchbase startup. This loop is only used during local development or CI tests, not in production.\n4. The `tests` folder, which defines the tests to run.\n5. The `docker-compose.test.yml` file, which extends `docker-compose.yml` with the additional test container.\n6. `.github/workflows/main.yml` provides an example CI run using GitHub Actions.\n\n\u003e :info: Additional dependencies required for the application may also be added to docker-compose.yml. This could include\n\u003e message buses, other databases, other microservices, StatsD agents, localstack to emulate AWS, and more.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrantburnett%2Fcouchbase-functional-testing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrantburnett%2Fcouchbase-functional-testing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrantburnett%2Fcouchbase-functional-testing/lists"}