Hacker Newsnew | past | comments | ask | show | jobs | submit | aranw's commentslogin

The problem with mocks is that they test your assumptions, not reality...

When you mock a CRM client to return one account, you're assuming it always returns one account, that IDs have a particular format, that there's no pagination, that all fields are populated. Each assumption is a place where production could behave differently whilst your tests stay green

Your contract tests use cached JSON fixtures. Salesforce changes a field type, your contract test still passes (old fixture), your mocks return the wrong type, production breaks. You've now got three test layers (contract, mock scenarios, E2E) where two can lie to you. All your contract and mock tests won't save you. Production will still go down

I have zero confidence in these types of tests. Integration tests and E2E tests against real infrastructure give me actual confidence. They're slower, but they tell you the truth. Want to test rate limiting? Use real rate limits. Want to test missing data? Delete the data.

Slow tests that tell the truth beat fast tests that lie. That said, fast tests are valuable for developer productivity. The trade-off is whether you want speed or confidence


Testing code is usually testing your code not that third party contract changed.

You make a lot of assumption about contract change which in reality should rarely happen.


> I really dislike this idea of testing in go: only ever use an interface, never the real implementation + mockgen the mocks based on this interface + use the mocks to assert that a function is called, with exactly this parameters and in this exact order.

Same I have zero confidence in these tests and the article even states that the tests will fail if a contract for a external service/system changes


I see this kind of testing as more for regression prevention than anything. The tests pass if the code handles all possible return values of the dependencies correctly, so if someone goes and changes your code such that the tests fail they have to either fix the errors they've introduced or go change the tests if the desired code functionality has really changed.

These tests won't detect if a dependency has changed, but that's not what they're meant for. You want infrastructure to monitor that as well.


https://samwho.dev has some fantastic blog posts with great visualisations


Thank you <3


Been trying to decide whether adopting a traditional RFC process or Oxide's RFD (https://rfd.shared.oxide.computer/rfd/0001) would better suit my team. We're using ADRs at the moment but we've ended up mixing a discussion like process into it and review process and using ADRs more like RFCs/RFDs


GitHub Vista Cloud Edition


After a couple of service packs will it be OK?


I'm currently working on a project that is using an OpenAPI library that decided to use a non-standard JSON encoder. The developer experience definitely suffers when you can't use common encoding/json patterns in your own code. Simple operations become unnecessarily awkward


I've been using the minio-go client for S3-compatible storage abstraction in a project I'm working on. This new change putting the minio project into maintenance mode means no new features or bug fixes, which is concerning for something meant to be a stable abstraction layer

Need to start reconsidering the approach now and looking for alternatives


There is probably a legitimate basis for some powers against actual foreign intelligence operations. But the proposals in the article defining "subversion" to include environmental activism, independence movements, or criticism of UK policy show how quickly these things expand beyond their original scope. The Terrorism Act was meant to exclude domestic activists but two decades later it has been used against protest groups


As is tradition. Put the tool in the toolbox, label it "it's for bad guys" to sell it to people, oh no, govt used it for something else, what a surprise.

And even if current government is 100% benevolent, just putting the tool in the toolbox means any subsequent govt, that might not be that, can use it.


> But the proposals in the article defining "subversion" to include environmental activism, independence movements, or criticism of UK policy show how quickly these things expand beyond their original scope.

Yes, but I wouldn't put "independence movements" in that list. Much as I'm relaxed about the Welsh and Scots' independence movements, for Northern Ireland to do whatever it wants including the current kicking-can-down-road approach, and for any future potential from the Cornish and London vague aspirations that nobody currently takes seriously…

… if I was a hostile foreign power, then I would absolutely support all of those campaigns. And more. (Independence for Langstone! :P)


I would do the same. But the response should be to root out foreign influence campaigns, and foreign money sponsoring divisive voices. A policy that marks your own people as subversive starts from a disadvantaged position.


So, you support the government labeling those movements as "subversion"? Your opinion isn't very clear here. If so, why are those movements so different, or are you supporting the government's move entirely, because of those cases?


Noticing that an issue has two opposing sides with good points doesn't mean I must pick a side to favour, nor even that I am competent to do so.

I'm in no position to weigh these things even in isolation, let alone against each other.

All I can do is say that I sympathise with everyone in the UK who wants independence from Westminster, and yet I would absolutely abuse the hell out of that kind of sentiment if I was a foreign agent trying to undermine the UK. Divide and conquor, very old technique.


It will never cease being funny to me how Eurocrats/Anglocrats pout their chests, proclaim proudly how "free" and "democratic" they are, and then proceed to implement a police state and surveillance regime which the DDR could only dream of. Sure you have "nothing to hide", and "intentions are good". Was that also true for every decade in European history? Will that also be true in 10 years? In 20 years?


>Eurocrats/Anglocrats pout their chests, proclaim proudly how "free" and "democratic" they are

That's weird, I've never met a single one since we don't even have a constitution to enshrine civil liberties.


Just listen to any politician talking about the "dictator" Trump while they arrest people over mean tweets.


oh politicians! Yeah fine I agree, but rest assured no member of the public labours under such delusion.

Things are bad, send help.


Europe has for a long time been the cradle of fascism. This type of behaviour should be seen as more of the same.


It’s not just the use against protest groups but selective use of it, that makes this extra bad. From the article:

> The risk is magnified by the racist and colonial legacy of Britain’s intelligence and policing institutions, whereby ‘loyalties’ and ‘foreign influence’ are racially coded terms. It is clear who the state thinks may constitute an agent of ‘foreign power’. Hall acknowledges the risk of “putting certain nationalities under the spotlight or appearing to question their loyalties”, but this is brushed over by the alleged extraordinary threat of national security risk.

This type of abuse of powers is already becoming normalized in America. For example, Governor Abbott of Texas and other politicians from right-leaning states have explicitly condemned Sharia Law and Islam, and are taking various actions to marginalize those communities. The recent incident with an Afghan national has further radicalized the right.

I can see how Sharia Law has no place in a democratic constitutional republic, but Christianity shares many of the same issues as Islam in terms of supremacist tendencies. And many on the right have no issue openly claiming that America is a Christian nation, and advocate for puritanical integration of their religion into law. This gets no condemnation from the right, and I doubt they’ll use their powers to stop the push for theocracy.


> I can see how Sharia Law has no place in a democratic constitutional republic

If there is a sizable population of people who really want to live like this, then why not? Demographics should be politically represented, no?


The war always comes home.


This is classic "think of the children" backdoors; whether in the legislation or enforcement or literal backdoors. Politicians know that no one is going to publicly come out and say a law to "protect" children shouldn't be passed.


[flagged]


Most antifascist groups are not protest groups. Most of them are watchdogs. When a story about military groups (including police) making nazi salutes or getting nazi tattoos or praying in front a a picture of Hitler come out, 99% of the time it's an antifa group that contacted a journalist and provided them picture, dates and specifics about the story. If you want to arrest all antifascists, you will have to arrest half of the OSINT community, because they're the one who developed a lot of the tools.


Antifa is not a group.


The attribution to TigerBeetle should be at the top of the page with a link to the original tigerstyle, not buried at the bottom. Right now it reads like official TigerBeetle content until you scroll down, which isn't fair to either you or the original team.


The author graciously gifted the domain to us and we’re literally days away from launching original TigerStyle here.


That's really nice of the author and awesome to hear. Would love to see TigerStyle be published in a similar format and expanded upon with more detail be great for referencing with my colleagues. Would love to adopt it on projects or some of the rules at least


Oh that's very nice of them.


I really like the evidence for the bug fix for "VR not rendering" in the "Fixed" section


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: