
Volkswagen – detects when your tests are run in a CI server, and makes them pass - JoshTriplett
https://github.com/auchenberg/volkswagen
======
watson
Hi, co-creator of volkswagen here. Just some fun trivia about the project,
which Kenneth and I obviously made as a joke years back when Volkswagen got
caught cheating:

The Node module actually works. If you use it, it will make all your tests
pass.

When writing the code, I put the logic for detecting if code is being run on a
CI server into a separate node module called is-ci[1] (which the volkswagen
module then depends on). That module (later split out into ci-info[2]) turned
out to be so useful for actual work, that today it's being used by both React
and the npm cli.

I only found this out recently. Imagine the surprise when a tiny part of a
joke project you created years ago turns out to be one of your most popular
open source projects :D

[1]: [https://www.npmjs.com/package/is-ci](https://www.npmjs.com/package/is-
ci) [2]: [https://www.npmjs.com/package/ci-
info](https://www.npmjs.com/package/ci-info)

~~~
nojvek
When Kenneth joined our team to work with us, I had no idea he was the co-
creator of volkswagen module. One day over lunch we were making jokes over how
funny that project is and we should legit add it to our workflow for shits and
giggles. He goes “yeah, I created that”. Our faces dropped. Whoa!

------
jay-anderson
Be sure to checkout the .gitignore:
[https://github.com/auchenberg/volkswagen/blob/master/.gitign...](https://github.com/auchenberg/volkswagen/blob/master/.gitignore)

~~~
chrisweekly

        # .gitignore:  
        node_modules  
        emissions  
        facts  
    

lol

~~~
_Schizotypy
This little gem makes the whole thing for me

------
nimbius
"If you want your software to be adopted by Americans"

Not to get too off-topic, but while taking the piss out of America is all good
fun it should be emphasized that the original nature of the scandal wasnt just
Americans whining about dirty engines.

[https://en.wikipedia.org/wiki/Volkswagen_emissions_scandal#L...](https://en.wikipedia.org/wiki/Volkswagen_emissions_scandal#Legal_and_financial_repercussions)

20 countries, the EU included, filed criminal charges against high level
executives at Volkswagen factories across the globe. the CEO himself was
arrested in Germany.

~~~
crunchlibrarian
As an American I find it endlessly amusing when Europeans poke fun at us, the
history of the 21st century so far makes it almost too easy. The jokes write
themselves.

But yes, Europeans should be as mad as anyone, the con of clean diesel that
has been foisted upon them has killed at least a few hundred over the years.

~~~
pc86
> clean diesel…has killed at least a few hundred over the years
    
    
        [citation needed]

~~~
rdl
Particulates and NOx.
[http://www.iiasa.ac.at/web/home/about/news/170918-diesel-
nox...](http://www.iiasa.ac.at/web/home/about/news/170918-diesel-nox.html)

~~~
mpweiher
"Health effect estimates"

"This new study estimates that ..."

~~~
abakker
Which means people did a study, and drew some conclusions, which you reject in
a comment on the internet. Do you have research that contradicts theirs? do
you have concerns with their methodology?

~~~
mpweiher
_estimates_ vs "has killed".

~~~
crunchlibrarian
Coal plants have killed. NOx emissions have killed. Lead has killed. Nuclear
waste has killed. Gamma rays have killed.

You're trying to complicate something that is very simple.

~~~
rdl
It is of course entirely possible that coal/lead/nuclear/etc. provide way more
benefit than the harm, too.

------
INTPenis
That title though. I clicked thinking there was yet another scandal in the
brewing but it's actually a software named volkswagen. If nintendo goes
batshit when people refurbish gameboys I wonder what volkswagen will do.

~~~
tshannon
I wonder if this would fall under protections for satire.

~~~
pvorb
I bet VW won't sue anyone about this soon to not have new negative publicity.
And I agree, this is clearly satire.

~~~
pc86
I bet nobody from VW is going to know this exists for a year or more, if ever.
How many VW corporate employees do you think browse HN?

~~~
InternetOfStuff
> How many VW corporate employees do you think browse HN?

Out of more than 600'000? A bunch, I bet.

(Yes, I was shocked at the number too)

------
birdiesanders
I appreciate the author of this library to no end. There is something to be
said about software being made in jest.

~~~
JoshTriplett
Other fun software made at least partly in jest (though still quite useful):

eatmydata
([https://packages.debian.org/sid/eatmydata](https://packages.debian.org/sid/eatmydata))
is an LD_PRELOAD library to disable filesystem syncs, to speed up test runs
and other cases where you don't care about data integrity (such as if losing
power would just mean you run the tests again from scratch anyway).

echochamber.js ([https://github.com/tessalt/echo-chamber-
js](https://github.com/tessalt/echo-chamber-js)) makes it look like your page
accepts comments, displays them to the person who submitted them, but doesn't
show them to anyone else.

~~~
aidanhs
comcast
([https://github.com/tylertreat/comcast](https://github.com/tylertreat/comcast))
is really helpful for simulating poor network connections. Particularly nice
when used in Docker to do network simulations.

------
kaycebasques
I've got lots of respect for Kenneth Auchenberg [1], the author of the
library. I suspect he's a driving force behind VS Code's current amazingness.
He also frequently has a lot of good insights about Chrome DevTools (what I
work on) and the web in general.

[1] [https://twitter.com/auchenberg](https://twitter.com/auchenberg)

------
rdl
If a VW lawyer contacts them to change the name, the obvious reply is “we will
happily rename to hitlercar.”

~~~
pkaye
Wolkswagon is better.

~~~
amyjess
Cloud wagon?

Well, I guess if you're using Travis, but it won't make much sense if you're
on a self-hosted Jenkins instance.

------
SilasX
Sigh... the dependencies remind me of the "left-pad" and "is-positive"
package.

Most of the heavy lifting on this one is done by the `is-ci` package [1],
which is what does (obviously) the "is this a CI server" request.

But it doesn't end there. `is-ci` just does a single call within the broader
`ci-info` library [2].

Any reason it couldn't have just imported `ci-info` and used its `isCI`
function?

[1] [https://github.com/watson/is-ci](https://github.com/watson/is-ci)

[2] [https://github.com/watson/ci-info](https://github.com/watson/ci-info)

~~~
watson
Hi, co-creator of volkswagen, is-ci, and ci-info here. I extracted is-ci into
its own module during the time I wrote volkswagen. It then turned out a lot of
people wanted a module like that for actual useful things. But they wanted
more info than simply "is this a CI server or not" (which was all that
volkswagen cared about). So I made ci-info and moved the logic into that
module and then made is-ci inherit from that, so to not have to duplicate the
logic

~~~
Dylan16807
Which is largely understandable, but shouldn't ci-info have obsoleted is-ci?

~~~
watson
You're free to just depend on ci-info directly if that's all you need of
course. The is-ci module does give you one added benefit however: It allows
you to run this on the command line:

$ is-ci && echo "I'm running in a CI environment"

But of course that could technically be baked into ci-info. It's just more
convenient to use with npx and to reason about if it's a self-contained module

------
kevincennis

        Test.prototype.fail = Test.prototype.pass
    

Dying.

------
asimpletune
I think there should be more digital art like this. By that I don’t mean
something but done with a computer, rather something that truly articulates
some genuine, sincere frontier of this digital landscape.

------
korethr
As funny as this is, I'd not be surprised to see a trademark challenge from VW
sooner or later.

~~~
DonHopkins
Kenneth Auchenberg: Well done! I hope that Volkswagen tries to sue you for
trademark infringement and totally embarrasses themselves by bringing even
more attention to their scandal, then gets slapped down and you can sue them
back for wasting the court's time.

Volkswagen should be a generic term for cheater, just like Kleenex is a
generic term for tissue.

~~~
plumeria
[https://www.urbandictionary.com/define.php?term=Volkswagen](https://www.urbandictionary.com/define.php?term=Volkswagen)

~~~
DonHopkins
[https://www.urbandictionary.com/define.php?term=Volkswagened](https://www.urbandictionary.com/define.php?term=Volkswagened)

~~~
plumeria
That's it!

------
wvenable
Probably quote marks around "Volkswagen" would make the title a lot more
clear.

~~~
dumbfounder
I agree, that would make it "clear".

------
piccolbo
The funny thing is that this is actually how R development works. The main
package repo is CRAN. If your package is not there, your inbox will fill with
"can't install help". But getting your tests to pass on CRAN is an obstacle
course. (see point 9 in
[http://kbroman.org/pkg_primer/pages/cran.html](http://kbroman.org/pkg_primer/pages/cran.html)
"put on your armor"). Your tests have to pass on Solaris when very few
developers have access to that OS anymore. So there are directives to skip
examples in the docs and what not (which should in theory run) but that
weakens your test suit for everyone. So someone developed wolkswagen for R,
for real
([https://rdrr.io/cran/testthat/man/skip.html](https://rdrr.io/cran/testthat/man/skip.html))
It's part of a mainstream, widely adopted test package, testthat. It's how the
R world goes.

------
United857
The tech industry has its own examples. I remember that Nvidia and/or AMD had
graphics drivers that would actually detect when they were running certain
benchmarks/games and "cheat" to get better results. This was proven by simply
renaming the .exe, which adversely affected measurements.

~~~
dmurray
Detecting popular games and optimizing for them isn't "cheating", it's best
practice for the graphics card companies although it makes some independent
game developers unhappy. Detecting the card is being run in a benchmarking
environment is cheating, though it may also be a sign the industry needs
better benchmarks.

------
halis
LMAO it looks like it would actually work in some cases, he mocks the assert
function.
[https://github.com/auchenberg/volkswagen/blob/master/.these/...](https://github.com/auchenberg/volkswagen/blob/master/.these/aren't/the/source/files/you're/looking/for.js)

------
SEJeff
Somewhat related (python not javascript), but not just for CI servers:

[https://github.com/ajalt/fuckitpy](https://github.com/ajalt/fuckitpy)

------
tzury
Not a lawyer or anything close, but I think Volkswagen is a trademark, and
when used in a way that makes fun of them, you are likely to wake up their
dogs (legal team) from their sleep.

~~~
JoeAltmaier
Not selling - no trademark infringement?

~~~
browsercoin
Unfortunately, whether they profited or not won't make a difference. Just from
the individual HN comments alone, there is enough to suggest that the title
easily creates the notion that it is Volkswagen that has authorized this
github. In fact, until I spent more time reading the comments and the github
repo page, did I realize it was not actually Volkswagen but an individual.

Basically, if you publish on a platform that is being used by other large
corporate brands, you should more or less expect zero legal protection from
the platform as ToS is not a legally binding contract.

------
themihai
Ok, now where is the Google/Facebook/Microsoft privacy test repository? If you
want your software to be adopted by Europeans, good privacy scores are very
important.

~~~
konschubert
Eh, no need to turn this into a EU/US pissing contest.

------
zelon88
I love the reference to the diesel emissions scandal. Nice touch.

------
pkaye
If they force a name change, change it to Wolkswagon.

------
clircle
My god, this is hilarious

------
solidrake
OMG, this is hilarious!!!

~~~
gammateam
did you see that custom build badge? saved!

[https://camo.githubusercontent.com/866c6cc451845f3de1f1487c1...](https://camo.githubusercontent.com/866c6cc451845f3de1f1487c16ad5879761b02fe/68747470733a2f2f61756368656e626572672e6769746875622e696f2f766f6c6b73776167656e2f766f6c6b7377617267656e5f63692e737667)

------
taf2
This put a nice smile on my face. Thank you

------
platz
At least they admitted to it.

Good luck getting the petrochemical industry to admit to any wrongdoing
they've ever done

