[PR #86] [CLOSED] Adding a Makefile and basic tests. #203

Closed
opened 2025-11-06 14:21:08 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/docker/awesome-compose/pull/86
Author: @metcalfc
Created: 8/8/2020
Status: Closed

Base: masterHead: bats


📝 Commits (8)

  • 702ec96 Adding a Makefile and basic tests.
  • 5185ced Fixing Mac vs Linux bash shell'ism.
  • 6565a1f Vendoring bats libraries.
  • c600fc3 Use assert_success from the bats-assert library.
  • d8a95fa Don't parse empty strings.
  • e059c77 Allow testing for just examples with changed files.
  • 199da87 Fixing Linux vs Mac Makefile differences.
  • 3d1fb4c First pass at a dockerized toolchain.

📊 Changes

79 files changed (+6452 additions, -0 deletions)

View changed files

Makefile (+28 -0)
angular/test.bats (+65 -0)
apache-php/test.bats (+65 -0)
aspnet-mssql/test.bats (+65 -0)
django/test.bats (+65 -0)
elasticsearch-logstash-kibana/test.bats (+65 -0)
extras/Dockerfile (+20 -0)
extras/bashrc (+12 -0)
flask/test.bats (+65 -0)
gitea-postgres/test.bats (+65 -0)
gitea-postgres/test.sh (+28 -0)
lib/bats-assert/.gitignore (+4 -0)
lib/bats-assert/.travis.yml (+3 -0)
lib/bats-assert/LICENSE (+116 -0)
lib/bats-assert/README.md (+661 -0)
lib/bats-assert/load.bash (+30 -0)
lib/bats-assert/package.json (+48 -0)
lib/bats-assert/src/assert.bash (+42 -0)
lib/bats-assert/src/assert_equal.bash (+42 -0)
lib/bats-assert/src/assert_failure.bash (+78 -0)

...and 59 more files

📄 Description

This approach uses bats to create a generic docker-compose test. It
checks that images are pullable, projects are buildable, up works, and
if ports are exposed that something is listening.

The tests can be tailored for each example. As long as they are the same
though, you can edit lib/test.bats.example and then make update-tests
and all the tests will be synced.

This adds three project dependencies: Makefile, BATS, and nc. A full clean
test run is PAINFULLY long (~14 minutes on my desktop) mostly
dominated by the build steps.

I've also added a target to just test whats changed. Since most of the time
PRs will just change one project. By default git finds the directories with
changes compared to origin master. You can override this with
BASE_REF=<whatever> make test-changed.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/docker/awesome-compose/pull/86 **Author:** [@metcalfc](https://github.com/metcalfc) **Created:** 8/8/2020 **Status:** ❌ Closed **Base:** `master` ← **Head:** `bats` --- ### 📝 Commits (8) - [`702ec96`](https://github.com/docker/awesome-compose/commit/702ec96821a889b6bb15815b9c8209a1f433411b) Adding a Makefile and basic tests. - [`5185ced`](https://github.com/docker/awesome-compose/commit/5185cedf4e5e3d154c148ae182c93c42db593c1e) Fixing Mac vs Linux bash shell'ism. - [`6565a1f`](https://github.com/docker/awesome-compose/commit/6565a1f7453da061898c4d8e2b740487e62203b2) Vendoring bats libraries. - [`c600fc3`](https://github.com/docker/awesome-compose/commit/c600fc36ca735f9ba67001f73918eda88cd28f02) Use assert_success from the bats-assert library. - [`d8a95fa`](https://github.com/docker/awesome-compose/commit/d8a95fadd893815986a163fa164625ee919b6666) Don't parse empty strings. - [`e059c77`](https://github.com/docker/awesome-compose/commit/e059c77a4705d8ff6341d190ec9b3652e59b3ec6) Allow testing for just examples with changed files. - [`199da87`](https://github.com/docker/awesome-compose/commit/199da87b3b8bcfc0c916a4ddd7888d18304d639c) Fixing Linux vs Mac Makefile differences. - [`3d1fb4c`](https://github.com/docker/awesome-compose/commit/3d1fb4c9a4a211d1be44cacaf3ec110ef47e7ddd) First pass at a dockerized toolchain. ### 📊 Changes **79 files changed** (+6452 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `Makefile` (+28 -0) ➕ `angular/test.bats` (+65 -0) ➕ `apache-php/test.bats` (+65 -0) ➕ `aspnet-mssql/test.bats` (+65 -0) ➕ `django/test.bats` (+65 -0) ➕ `elasticsearch-logstash-kibana/test.bats` (+65 -0) ➕ `extras/Dockerfile` (+20 -0) ➕ `extras/bashrc` (+12 -0) ➕ `flask/test.bats` (+65 -0) ➕ `gitea-postgres/test.bats` (+65 -0) ➕ `gitea-postgres/test.sh` (+28 -0) ➕ `lib/bats-assert/.gitignore` (+4 -0) ➕ `lib/bats-assert/.travis.yml` (+3 -0) ➕ `lib/bats-assert/LICENSE` (+116 -0) ➕ `lib/bats-assert/README.md` (+661 -0) ➕ `lib/bats-assert/load.bash` (+30 -0) ➕ `lib/bats-assert/package.json` (+48 -0) ➕ `lib/bats-assert/src/assert.bash` (+42 -0) ➕ `lib/bats-assert/src/assert_equal.bash` (+42 -0) ➕ `lib/bats-assert/src/assert_failure.bash` (+78 -0) _...and 59 more files_ </details> ### 📄 Description This approach uses bats to create a generic docker-compose test. It checks that images are pullable, projects are buildable, up works, and if ports are exposed that something is listening. The tests can be tailored for each example. As long as they are the same though, you can edit lib/test.bats.example and then `make update-tests` and all the tests will be synced. This adds three project dependencies: Makefile, BATS, and nc. A full clean test run is PAINFULLY long (~14 minutes on my desktop) mostly dominated by the build steps. I've also added a target to just test whats changed. Since most of the time PRs will just change one project. By default git finds the directories with changes compared to `origin master`. You can override this with `BASE_REF=<whatever> make test-changed`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-06 14:21:08 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/awesome-compose#203