this post was submitted on 25 May 2024
367 points (98.4% liked)

Programmer Humor

34834 readers
51 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
top 32 comments
sorted by: hot top controversial new old
[–] [email protected] 217 points 10 months ago (5 children)

See your problem is you're editing the code until it passes the tests. It's way easier if you edit the tests until it passes the code.

[–] [email protected] 108 points 10 months ago (1 children)

This is what they mean by test driven development.

[–] [email protected] 5 points 10 months ago
[–] [email protected] 36 points 10 months ago

Can't tell if you are joking. I know a lot of junior developers who think this is a legitimate solution.

[–] [email protected] 24 points 10 months ago (3 children)

Unless you are using groovy (jenkins), then you are running the pipeline to find syntax errors.

[–] [email protected] 15 points 10 months ago

This comment is triggering and it should have a NSFW spoiler.

[–] [email protected] 5 points 10 months ago (1 children)

I hate groovy, gradle and Jenkins!

I don't know if sth. Else is better but I can confirm that shit is horrific

[–] [email protected] 1 points 10 months ago (1 children)
[–] [email protected] 0 points 10 months ago

Horrible scripting language. Even worse than python. Close to Javascript

[–] savedbythezsh 4 points 10 months ago (2 children)

FYI, Jenkins has an endpoint to validate the pipeline without running it, and there's a VSCode extension to do this without leaving the editor: https://www.jenkins.io/blog/2018/11/07/Validate-Jenkinsfile/

[–] [email protected] 2 points 10 months ago (1 children)

I am not using Jenkins anymore but this seems like a lifesaver, thanks for sharing

[–] savedbythezsh 1 points 10 months ago

I use Jenkins for work, unfortunately, so I have plenty of experience

[–] [email protected] 1 points 10 months ago

Only for declarative pipelines, forget it if you use scripted ones.

[–] [email protected] 7 points 10 months ago

I just replace all my tests with noop codes. Quick, easy, passes.

[–] [email protected] 4 points 10 months ago

If true == true pass!

[–] [email protected] 94 points 10 months ago
[–] [email protected] 36 points 10 months ago* (last edited 10 months ago) (1 children)

DevOps is bad because for some reason we've decided to invent new programming languages that you can't debug locally and so you have to keep pushing commits to the pipeline server. It's bullshit.

"Why do you write all your pipelines as shell scripts and then wrap them in yaml at the very end"?

Because then I can run them locally quickly and test individual components of them instead of "edit, commit, push, wait 10 minutes, read error message, repeat".

[–] [email protected] 13 points 10 months ago (1 children)

FWIW, gitlab-runner exec and earthly exist for running tests locally, with others things like nektos/act for GHA as a 3rd party solution. I’ll never get used to yaml, though, all my pipelines are mostly shell scripts. Using a markup language as a programming language was definitely one of the decisions of all time.

[–] [email protected] 2 points 10 months ago (1 children)

Gitlab-runner exec and act are great tools, but this goes out of the window as soon as the cloud hosting service is a little less intelligent (looking at you, azure DevOps, who removed the hack that let pipeline run locally in 2019)

[–] [email protected] 1 points 10 months ago

That’s why earthly exists. Now you can run your pipeline on a container with a “familiar syntax” inside another container with a “familiar syntax” inside of a “reproducible, easy-to-use” VM provisioned on top of probably KVM, as Torvalds intended

[–] [email protected] 35 points 10 months ago (1 children)

You just need to learn from big automakers and use Volkswagen!

[–] [email protected] 5 points 10 months ago

Sir, you just made my day thank you!

[–] [email protected] 33 points 10 months ago (1 children)

How are you bad?

You got a green verification checkmark on the same day! That's a win!

[–] [email protected] 1 points 10 months ago

My build environment has 3 jillion unneeded builds going. I am lucky to get 2 build failures in a single day.

[–] [email protected] 28 points 10 months ago (1 children)

Local tests are less shameful. Imagine if you had a Red X online for every compiler or syntax error whilst developing.

So it is.

[–] [email protected] 10 points 10 months ago

This is what it looks like when I'm working on Jenkin files.

[–] [email protected] 14 points 10 months ago

And only one of those runs has complete logs containing the actual error causing the failure.

[–] [email protected] 6 points 10 months ago (1 children)
[–] [email protected] 6 points 10 months ago

development build of call of duty black ops

[–] [email protected] 5 points 10 months ago

If the build doesn't fit, you must...rerun the test suite locally

[–] [email protected] 5 points 10 months ago

Come on! You need those red crosses to know it fails as it should. Thats what I would say they are there for :-)

[–] [email protected] 3 points 10 months ago

As a fellow jenkins miner. I know this red (x) all too well.