I Only Test In Production

Поделиться
HTML-код
  • Опубликовано: 11 янв 2025

Комментарии • 90

  • @TomNook.
    @TomNook. 7 месяцев назад +133

    These thumbnails are way better than those fake tweet ones

    • @PatrikTheDev
      @PatrikTheDev 7 месяцев назад +1

      Agreed, the fake tweets work but this feels way more legitimate

    • @zyzlol
      @zyzlol 7 месяцев назад +2

      I skip the videos with fake tweet thumbnails

    • @Sammysapphira
      @Sammysapphira 7 месяцев назад +1

      ​@@zyzlolme too

    • @ridass.7137
      @ridass.7137 7 месяцев назад +2

      crybabies, here they come 👶

    • @Quephara
      @Quephara 7 месяцев назад +1

      Theo is the reason I got an extension to change thumbnails on RUclips. He has good videos but the thumbnails were that bad

  • @ottomanherox
    @ottomanherox 7 месяцев назад +118

    Just test in production so your users can be the QA team, save costs!

    • @jbkerns
      @jbkerns 7 месяцев назад +9

      Works for Microsoft and others

    • @marktiempo466
      @marktiempo466 7 месяцев назад +5

      works for many AAA games

    • @rapzid3536
      @rapzid3536 7 месяцев назад

      Shift left.

  • @leetdavid
    @leetdavid 7 месяцев назад +27

    To quote zack freedman: in practice, the difference between theory and practice is greater in practice than in theory

    • @MrDadidou
      @MrDadidou 7 месяцев назад

      The difference between theory and practice is that theory does not work in practice

    • @andrewgora5446
      @andrewgora5446 7 месяцев назад

      If in theory, the difference between theory and practice is less in theory than in practice; but in practice, the difference between theory and practice is greater in practice than in theory; then in theory, is the difference between theory and practice actually greater in theory than in practice?

  • @Malix_Labs
    @Malix_Labs 7 месяцев назад +79

    They test in prod because of real datasets
    I test un prod because I don't know what i'm doing
    We're not the same

    • @TheBswan
      @TheBswan 7 месяцев назад +2

      You guys are testing? I just hit deploy and grab a new ticket

    • @codeChuck
      @codeChuck 7 месяцев назад +1

      True :D

  • @samcalder6946
    @samcalder6946 7 месяцев назад +18

    Every app has a Test environment. Some of them also have a separate Production environment.

  • @matteusan
    @matteusan 7 месяцев назад +34

    time to push to prod on save

    • @codeChuck
      @codeChuck 7 месяцев назад +1

      Best strat ever!

  • @05xpeter
    @05xpeter 7 месяцев назад +8

    Our precommit hooks include linting(we have developers on Windows, Linux, Mac, VsCode, PyCharm, with and without autosave, so to have the linting enforced and the same is essential), checks that you are not commiting to the main branch, checks that you are not editing commited migration files. I think it is only a benefit.

    • @PatrikTheDev
      @PatrikTheDev 7 месяцев назад

      I know it’s not always possible but I would recommend merging on the same editor or at least same local formatter (so probably Prettier with a common config, so that users can write however they want but the result will be consistent)

    • @robertluong3024
      @robertluong3024 7 месяцев назад +1

      We use husky to prettier and lint things. It just auto-formats things before you do your PR. It runs fast so you won't have to worry.
      For commiting to main branch would making it protected help? because it would stop you from pushing to it right?

    • @StefanErwinBaumer
      @StefanErwinBaumer 7 месяцев назад +3

      Those tests should be run on a server managing the repository, not on the devs' local machines, especially because hooks can be skipped. especially committing to the main branch should be something that is handled by your repository's permissions, not a hook.
      Do you really want to stop devs from making a backup of their work on a feature branch at the end of their work day because of a linter noncompliance?

    • @PatrikTheDev
      @PatrikTheDev 7 месяцев назад

      @@StefanErwinBaumer prettier wouldn’t ever block you from committing unless what you committed was not valid code/syntax, then it would probably be valid to stop the commit
      Doing so for linting is a separate issue

    • @CTimmerman
      @CTimmerman 7 месяцев назад

      ​@@StefanErwinBaumerJust look at the warnings sometimes. Don't force others to.

  • @ivanmaglica264
    @ivanmaglica264 7 месяцев назад +2

    TISAX certification (a subset of ISO 27001 for automotive industry) requires that your development process has staging environment. If you told to the auditor that you only test in prod, he would close the notebook and say "See you in six months".

  • @zaneearldufour
    @zaneearldufour 7 месяцев назад +4

    Re pre-commit hooks:
    Theos opinion is only valid for J/TS development on this one, because in python and Go, the relevant formatters are basically never blockers (and pre-commit always canceling the commit on files changed is better behavior than husky silently changing files)

  • @SJohnTrombley
    @SJohnTrombley 7 месяцев назад +2

    That quote about the difference between theory and practice is a paraphrase of Yogi Berra.

  • @thebunsenburner
    @thebunsenburner 7 месяцев назад +2

    We have a test server just for this, which we push to before prod. Helped us avoid a nasty bug at least once.

  • @n4bb12
    @n4bb12 7 месяцев назад

    0:40 "randomly click around" is not a bad idea (maybe just do it before prod). I've seen projects write hordes of tests just to produce a 500 on first use which they missed because they never used the thing they were building. You'll learn a lot about the thing you're building by using it.

  • @JacobGorny
    @JacobGorny 7 месяцев назад +2

    Incremental failure is a beautiful thing in prod. Way better than catastrophic failure in prod which happens with overconfidence.

  • @joelv4495
    @joelv4495 7 месяцев назад +1

    One thing that wasnt covered is DATA. Often the application code depends on assumptions about the data structure beyond the raw db schema. Yes, you could use zod but what to do about legacy data that doesnt fit the current model?

  • @TheVoiceofTheProphetElizer
    @TheVoiceofTheProphetElizer 7 месяцев назад

    I often told people at my university that production was the greatest test environment I was aware of. Rarely do you get a second chance to make a first impression, and testing in production solves none of these things, but boy is it fun!

  • @boscodomingo
    @boscodomingo 7 месяцев назад

    About pre-commit hooks: I agree. However, pre-push hooks are perfectly fine. You don't push anywhere as often, and the only time where it matters what you've done with code is when you share it

  • @michaelslattery3050
    @michaelslattery3050 7 месяцев назад +1

    Good points. Disagree that shouldn't have a staging server. It can catch a lot of deployment issues.
    I also believe in a simple smoke test that hits all the integration points (login, send email, charge CC, upload/download with S3, other external rest APIs). It just makes sure integrations aren't broken, it doesn't test logic. This further makes the staging environment important. It might just be a /health page. You can also run the smoke test on prod immediately after deployment.

    • @Tynach
      @Tynach 7 месяцев назад

      I'm honestly not sure how their "Test on a server with a copy of the production data" _isn't_ just a staging or testing server. In fact, none of the things they list seem like 'testing in production' to me, but instead a combination of staging/testing servers with old copies of production data, combined with standard monitoring.
      I guess A/B testing, but that's less about testing code and more about testing if users like a change or not. In other words, it's not the code you're testing, it's the users.

  • @m4rt_
    @m4rt_ 7 месяцев назад

    Fun fact, there is a hidden setting on discord that the developers use to test new features, and variations on new features.
    If you find a way to activate it (they sometimes patch the ways people activate it) you can try out new features early.
    (It's called "experiments" btw)

  • @tomatao.
    @tomatao. 7 месяцев назад

    re pre-commit hooks... it's sooo easy to make a git alias that appends `--no-verify` for a convenient opt out of pre-commit hooks when developing WIP. On the other hand, having that local check before waiting for a bunch of CI to start running can save hours over the course of a day. The important thing is that the pre-commit hooks should take less than 10 seconds - ideally 1 or 2 seconds
    Here's a bunch for anyone interested:
    cn = commit --no-verify
    cmn = commit -m --no-verify
    can = commit -a --no-verify
    camn = commit -am --no-verify
    cian = commit --amend -C HEAD --no-verify
    psn = push --no-verify
    pfn = push --force-with-lease --no-verify
    pffn = push --no-verify

  • @mainendra
    @mainendra 7 месяцев назад +1

    How do you make sure that we’re not leaking feature in production and feature flag works as expected? 😊

  • @ScottMaday
    @ScottMaday 7 месяцев назад +5

    Pushing to prod? Theo looks like he's pushing out the biggest log know to man in the thumbnail

  • @allie-ontheweb
    @allie-ontheweb 7 месяцев назад +1

    What's wrong with staging just being a snapshot of production?
    All the benefits of this approach, none of the "oh fuck I've deleted a user's entire account"
    Edit: 2:38
    I really wouldn't call that testing in prod though. But maybe that's bc it's the only thing I have experience with

  • @michaelm3691
    @michaelm3691 7 месяцев назад

    14:40 I see apple lawyers finally forced ikea to drop the i.

  • @ElvenSpellmaker
    @ElvenSpellmaker 4 месяца назад

    _"Let me know in my Pull Request that my code is wrong, don't prevent me from committing because you don't like the way I did my code"_ --Theo 2024
    I support this wholeheartedly, I've been championing this idea for years.

  • @BlazeShomida
    @BlazeShomida 7 месяцев назад

    When it comes to pre commit hooks, what about something like biome that lints and formats in the less than a sec? Or using husky to do lint/format (w/ Biome or eslint+prettier) as a pre-push hook? This way you can run your linting/formatting locally which will in theory run faster than your CI before you push and you can commit as much as you want, without slowdown. Also this way you reduce needing to rewrite your local git history for a formatting/linting change and force push to remote.

  • @codeChuck
    @codeChuck 7 месяцев назад

    A dancing crew should train a lot and make 'test runs' before giving the final performance.
    Testing - like repetition to become 'almost perfect' - is essential to give a good performance to the people.
    If you are creating stuff and do not test it, it will break and will freak out the users, so IRL you should become a Sir or Lady 'TestALot', so your users do not experience any incovenient bugs with your product.

  • @rangerboi9715
    @rangerboi9715 7 месяцев назад +3

    Staging? What’s that? Real men test in prod

  • @jorgekauerss
    @jorgekauerss 2 месяца назад

    Crowdstrike Falcon engineering team likes this.

  • @ShellBryson
    @ShellBryson 7 месяцев назад

    Hah. How about a bit of both? Side project only has a single prod database, but I have local dev and prod envs for the front end code... 😅

  • @nobilissimum_io
    @nobilissimum_io 7 месяцев назад

    You didn't test the peace nerds bit in the end on your dev environment

  • @CTimmerman
    @CTimmerman 7 месяцев назад

    Cool, except for the paste near the Titanic, but that's what waivers are for.

  • @Kane0123
    @Kane0123 7 месяцев назад

    Where else would you test code other than your own machine?

  • @andrej-ota
    @andrej-ota 7 месяцев назад

    Everyone is testing in production, some of us just have a good fortune to have a separate system that approximates some parameters of production in addition to production. Whoever imagines they're not testing in production either has more services than customers or is fooling themselves.
    Seriously: Software in production will invariably eventually fail, not accounting for it and prepared beforehand for it is asking for trouble.

  • @m4rt_
    @m4rt_ 7 месяцев назад

    I once had to test a UI update directly in prod...
    that was fun.
    (sarcasm)
    I was tasked with fixing a huge bug with the UI, and I could only test it in production (because of some data, etc, that was missing from the test environments... we could technically have done it in a test environment, but that would require setting up a lot of stuff that we didn't have time to set up), so I attempted to fix the bug, and I tested that the code should in work in theory, but I had to test the actual UI by pushing it to production. After debugging some bugs in the framework we were using, I finally got it working after a few tries.

  • @codeChuck
    @codeChuck 7 месяцев назад

    Oh, no! It is zombies :) They broke the internet and Theo couldn't say 'Peace, Nerds' at the end of the video!

  • @joshuamanlunas8862
    @joshuamanlunas8862 7 месяцев назад

    Would people risk testing in production for a massive Internet Banking monolith, where a "small fail" costs a minimum 6 figure in fines by the government and various regulatory entities?

  • @devOnHoliday
    @devOnHoliday 7 месяцев назад

    As a php dev I edit the production code in notepad

  • @trollingdirty8910
    @trollingdirty8910 7 месяцев назад

    Use the word "Validate" when it comes to "Producton." Then the CAB and CTO are onboard ;😉

  • @codeChuck
    @codeChuck 7 месяцев назад

    Like the video before watching :)
    Becaise od thumbnail! Like it!
    As a joke goes 'The real men rest in production' :D

  • @usmanabdurehman97
    @usmanabdurehman97 7 месяцев назад

    Theo to WWE, confirmed.

  • @AHMEDTHAER2
    @AHMEDTHAER2 7 месяцев назад

    Size doesn't matter good take lmfao

  • @bradweir3085
    @bradweir3085 7 месяцев назад

    We have to use mock data because of HIPPA compliancy.

  • @RealDatBear
    @RealDatBear 7 месяцев назад +2

    Please please please learn about git commit --no-verify

  • @briankarcher8338
    @briankarcher8338 7 месяцев назад

    I cannot express in words how much I detest Husky. The first thing I do when opening a new project is to turn that crap off.
    It is literally the worst package in the history of programming.

  • @devpitch
    @devpitch 7 месяцев назад +1

    Only fools test in production, everyone else mirrors into pre-prod/uat or startups. It's true however, that certain validations cannot be performed in lower env. But it's not the same as "testing". Production validation should only involve making sure components are deployed and configured.

  • @listener8228
    @listener8228 7 месяцев назад

    Best case everything works.
    Worst case you get fired 💀

  • @ej3281
    @ej3281 7 месяцев назад

    post hog? okay

  • @moosegoose1282
    @moosegoose1282 7 месяцев назад

    i fking h8 husky too

  • @KhizarKhan2001
    @KhizarKhan2001 7 месяцев назад +2

    That thumbnail 😬

  • @Tooo2-zz1nn
    @Tooo2-zz1nn 7 месяцев назад

    never wrote a test, my code is perfect from init

  • @eliastouil7686
    @eliastouil7686 7 месяцев назад

    Sad cuz you didn’t say “peace nerds” :,(

  • @MuhammadAhmad-ke5cl
    @MuhammadAhmad-ke5cl 7 месяцев назад

    for size of business maybe think binance

  • @5h4ndt
    @5h4ndt 7 месяцев назад +1

    It really depends on what prod does and what the impact of the change is. I've been a system administrator for companies that are manufacturing. You don't want to ever risk fucking up the assembly lines. But our BW process? Fuck that, they can wait a day or two if push comes to shove, test in prod.

  • @StefanvonderKrone
    @StefanvonderKrone 7 месяцев назад +1

    Hate precommit hooks as well! They‘re annoying. And most of them can be replicated in a better in CI

    • @CTimmerman
      @CTimmerman 7 месяцев назад

      But then you get incremental lint/bug fixing commits, which might upset people who want a "clean" history.

    • @StefanvonderKrone
      @StefanvonderKrone 7 месяцев назад

      I‘d rather have the CI just inform me about issues and abort the build. It‘s my duty to fix those issues

  • @osbyrne
    @osbyrne 7 месяцев назад

    hell yea

  • @rjmunt
    @rjmunt 7 месяцев назад +5

    Tell me you have a small team and a product no one cares about.

    • @gintoki_sakata__
      @gintoki_sakata__ 7 месяцев назад +2

      We all start somewhere

    • @doc8527
      @doc8527 7 месяцев назад

      ​@@gintoki_sakata__ Everyone all acts like they are the tech lead/CTO/founder of something who scales the architecture from hundred to million, or a team of several to hundred.
      Speaking from real anecdotes: 99% are just random dude joining a small/big team by luck where everything already had setup for them. All they did is just creating a new account, or adding cli commends (by copy/paste the existing example as guidance then twist around) for new features. But they all act like they setup the whole infra pipeline.
      Even for building a new team, most just don't have an idea how to manage people and possibly scale the number back after a year of money burning, and obviously big layoff. Larger companies just appears to have more free money to burn, longer time to figure out all the team problems.

  • @gbube054
    @gbube054 7 месяцев назад

    I'm too early for this 😅