Skip to content

Instantly share code, notes, and snippets.

View agosmou's full-sized avatar

Alejandro Gomez agosmou

View GitHub Profile
@agosmou
agosmou / README.md
Created December 10, 2023 00:19
Hand Rolling State Machine (Traffic Light Example)

Hand Rolling State Machine (Traffic Light Example)

Handroll

This is to get a general idea of what handrolling could look like:

  • Statechart Pattern
    • states
    • triggers
    • transitions
C:\Users\agome\testcontainers-java-repro>mvn -Dtest=org.testcontainers.repro.ReproExampleTest test
[INFO] Scanning for projects...
[INFO]
[INFO] ---------< org.testcontainers.repro:testcontainers-java-repro >---------
[INFO] Building testcontainers-java-repro 1.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- resources:3.3.1:resources (default-resources) @ testcontainers-java-repro ---

Fails

PS C:\_code\testcontainers-go\modules\postgres> go test -v
=== RUN   TestPostgres
=== RUN   TestPostgres/Postgres
2023/11/22 22:10:13 🐳 Creating container for image docker.io/testcontainers/ryuk:0.5.1
2023/11/22 22:10:13 ✅ Container created: 68f51bbccb36
2023/11/22 22:10:13 🐳 Starting container: 68f51bbccb36
2023/11/22 22:10:14 ✅ Container started: 68f51bbccb36
2023/11/22 22:10:14 🚧 Waiting for container id 68f51bbccb36 image: docker.io/testcontainers/ryuk:0.5.1. Waiting for: &{Port:8080/tcp timeout:<nil> PollInterval:100ms}

Connexion vs Traditional Flask API Development

This guide compares how certain tasks are handled with and without the connexion library in Python.

1. API-First Design

With connexion:

  • Define your API in a YAML or JSON file using the OpenAPI Specification.
  • The connexion app reads this file and sets up the API.