apuntes:testing
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| apuntes:testing [2026/09/27 22:45] – [Docker compose] Santiago Faci | apuntes:testing [2026/09/28 22:10] (current) – [Test de integración] Santiago Faci | ||
|---|---|---|---|
| Line 8: | Line 8: | ||
| ===== Test unitarios ===== | ===== Test unitarios ===== | ||
| + | Se implementan para testear la unidad mínima de código, que normalmente serán funciones o métodos, de forma totalmente aislada del resto de la aplicación. | ||
| ==== Clases de utilidad ==== | ==== Clases de utilidad ==== | ||
| Line 128: | Line 129: | ||
| ===== Test de integración ===== | ===== Test de integración ===== | ||
| + | |||
| + | En este caso escribimos tests que permitan probar varios componentes juntos para verificar que trabajan bien cuando interactuan entre si. | ||
| * Caso de uso: **Ok (200 OK)** | * Caso de uso: **Ok (200 OK)** | ||
| Line 347: | Line 350: | ||
| container_name: | container_name: | ||
| environment: | environment: | ||
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| volumes: | volumes: | ||
| - ./ | - ./ | ||
| Line 396: | Line 399: | ||
| branches: | branches: | ||
| - main | - main | ||
| - | - develop | ||
| jobs: | jobs: | ||
| newman: | newman: | ||
| runs-on: ubuntu-latest | runs-on: ubuntu-latest | ||
| + | | ||
| + | strategy: | ||
| + | matrix: | ||
| + | node-version: | ||
| + | | ||
| steps: | steps: | ||
| - uses: actions/ | - uses: actions/ | ||
| - | - uses: actions/ | + | - uses: actions/ |
| with: | with: | ||
| - | | + | |
| - | java-version: '21' | + | cache: 'npm' |
| - | - run: mvn package | + | - run: npm install |
| - | - run: docker build -t games-api . | + | - run: docker build -t cities-api . |
| - run: docker compose up -d | - run: docker compose up -d | ||
| - run: npm install -g newman | - run: npm install -g newman | ||
| - | - run: newman run games.postman_collection.json -e local.postman_environment.json | + | - run: newman run cities.postman_collection.json -e local.postman_environment.json |
| </ | </ | ||
apuntes/testing.1790549105.txt.gz · Last modified: by Santiago Faci
