- Unit tests are testing kernel
- Integration tests are testing ports
- Component tests are testing adapters
- System tests are testing multiple systems (hexagons)
https://speakerdeck.com/skmetz/magic-tricks-of-testing-railsconf?slide=187
#!/usr/bin/env python | |
import argparse | |
import getpass | |
import sys | |
from contextlib import contextmanager | |
from distutils.util import strtobool | |
def yes_or_no(question, default='no'): | |
"""Ask question and wait for yes/no answer. |
https://speakerdeck.com/skmetz/magic-tricks-of-testing-railsconf?slide=187
Notes to modularity talk:
Install https://github.com/jrfonseca/gprof2dot
$ python -m cProfile -o profiler.pstats ./some/python/code.py
$ gprof2dot -f pstats profiler.pstats | dot -Tpng -o profiler.png # generate PNG calltree image
$ pyprof2calltree -i profiler.pstats -k # debug with kcachegrind
https://www.youtube.com/watch?v=zXCiv4sc5eY
Failure = Repeating the bad decisions
Success = Consistency on good decisions
Rule of success = Delay gratification!
Short memo from:
For not finished / not tested features
#!/usr/bin/env bash | |
set -eu | |
pane_fmt="#{pane_id} #{pane_in_mode} #{pane_input_off} #{pane_dead} #{pane_current_command}" | |
tmux list-panes -s -F "$pane_fmt" | awk ' | |
$2 == 0 && $3 == 0 && $4 == 0 && $5 ~ /(bash|zsh|ksh|fish)/ { print $1 } | |
' | while read -r pane_id; do | |
# renew environment variables according to update-environment tmux option | |
# also clear screen |
if [[ -n "$PS1" ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_CONNECTION" ]]; then | |
tmux attach-session -t ssh_tmux || tmux new-session -s ssh_tmux | |
fi |
version: '3' | |
services: | |
sentry: | |
image: 'sentry:latest' | |
command: start | |
networks: | |
- sentry | |
- traefik-public | |
depends_on: | |
- redis |
from typing import Any, Callable, TypeVar, cast | |
F = TypeVar('F', bound=Callable[..., Any]) | |
# A decorator that preserves the signature. | |
def my_decorator(func: F) -> F: | |
def wrapper(*args, **kwargs): | |
print("Calling", func) | |
return func(*args, **kwargs) |