As was foretold, we've added advertisements to the forums! If you have questions, or if you encounter any bugs, please visit this thread: https://forums.penny-arcade.com/discussion/240191/forum-advertisement-faq-and-reports-thread/

[Programming] Thread: Fixed last bug in 5 month thread

1246799

Posts

  • urahonkyurahonky Registered User regular
    Ugh 459 unit tests with coverage takes ~5 minutes to complete.

  • urahonkyurahonky Registered User regular
    Which is funny because our Maven builds at my previous job were upwards of 30 minutes... And that's WITH skipTests=true set.

  • bowenbowen How you doin'? Registered User regular
    edited March 2015
    This is why doing shit right and not hamstringing people for the illusion of security is a smart idea.

    bowen on
    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • Jimmy KingJimmy King Registered User regular
    Looks about on par with some of my Django projects. I know the biggest one has several test cases which make http requests out to external api's which have not yet been properly mocked out and a large chunk of the time is spent in those tests.

  • urahonkyurahonky Registered User regular
    bowen wrote: »
    This is why doing shit right and not hamstringing people for the illusion of security is a smart idea.

    I was thinking about this. It can't be because of security. If it takes us 8 weeks to do something that should really take 2 weeks then they can bill the Government more time and more money. This gives them more money back since they charge them the contractor rate which is certainly well above how much I was actually making.

  • bowenbowen How you doin'? Registered User regular
    urahonky wrote: »
    bowen wrote: »
    This is why doing shit right and not hamstringing people for the illusion of security is a smart idea.

    I was thinking about this. It can't be because of security. If it takes us 8 weeks to do something that should really take 2 weeks then they can bill the Government more time and more money. This gives them more money back since they charge them the contractor rate which is certainly well above how much I was actually making.

    That's certainly a part of it, sure.

    But they can't string them along indefinitely, and the way it was going for you, something that would take a few days was taking you a few months. There's no way that's sustainable. It probably is because US gov't's military budget is intense, but, still, someone will catch on and deliver a faster, better product in half the time and they're fucked.

    If the company has a lot of top secret clearance type stuff, you've likely got a lot of red tape for interoffice stuff that needs to be dealt with like that. Either way, proper security wouldn't impact you in the slightest.

    But we all know the feds are really into security theater.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • EtheaEthea Registered User regular
    On our continuous builds with everything enabled we have 2100 tests that complete in ~22m. I would say about 3/4 of those tests are rendering tests, but don't have a real user interface.

    Our actual client application has about 600 user level interaction tests and those take ~1h to run in serial.

  • djmitchelladjmitchella Registered User regular
    oh, let me tell you about tests..

    The previous project I was on has 5,500 unit tests that run on each commit and gate the deploy-to-dev-environment, takes ~16 minutes to run those (and ~45 minutes for the total build). That's the quick bit.

    dev -> UAT runs 96 automated interaction tests, total of 3h41 minutes (split up into 8 parallel test runs. There's a _lot_ of environment-related setup/teardown overhead in these tests, and a given test validates more than one thing, and a large number of them run in multiple browsers at once to confirm that multi-user interactions work as expected)

    UAT -> preprod is 138 tests, total of ~16h50 minutes, split into 19 parallel runs.

    and after all that, it's still not quite continuous deployment; preprod -> prod is gated by manual testing because of all the different devices we have to test against.

  • EtheaEthea Registered User regular
    oh, let me tell you about tests..

    The previous project I was on has 5,500 unit tests that run on each commit and gate the deploy-to-dev-environment, takes ~16 minutes to run those (and ~45 minutes for the total build). That's the quick bit.

    dev -> UAT runs 96 automated interaction tests, total of 3h41 minutes (split up into 8 parallel test runs. There's a _lot_ of environment-related setup/teardown overhead in these tests, and a given test validates more than one thing, and a large number of them run in multiple browsers at once to confirm that multi-user interactions work as expected)

    UAT -> preprod is 138 tests, total of ~16h50 minutes, split into 19 parallel runs.

    and after all that, it's still not quite continuous deployment; preprod -> prod is gated by manual testing because of all the different devices we have to test against.

    That sounds beautiful to me.

  • mightyjongyomightyjongyo Sour Crrm East Bay, CaliforniaRegistered User regular
    Haha, unit tests

    those are still on our to-do list.

  • urahonkyurahonky Registered User regular
    bowen wrote: »
    urahonky wrote: »
    bowen wrote: »
    This is why doing shit right and not hamstringing people for the illusion of security is a smart idea.

    I was thinking about this. It can't be because of security. If it takes us 8 weeks to do something that should really take 2 weeks then they can bill the Government more time and more money. This gives them more money back since they charge them the contractor rate which is certainly well above how much I was actually making.

    That's certainly a part of it, sure.

    But they can't string them along indefinitely, and the way it was going for you, something that would take a few days was taking you a few months. There's no way that's sustainable. It probably is because US gov't's military budget is intense, but, still, someone will catch on and deliver a faster, better product in half the time and they're fucked.

    If the company has a lot of top secret clearance type stuff, you've likely got a lot of red tape for interoffice stuff that needs to be dealt with like that. Either way, proper security wouldn't impact you in the slightest.

    But we all know the feds are really into security theater.

    Everything I was doing was unclassified materials.

  • admanbadmanb unionize your workplace Seattle, WARegistered User regular
    Haha, unit tests

    those are still on our to-do list.

    Putting unit tests on a to-do list is the same thing as saying you're not going to do them, so you may as well just take the plunge... and delete that to-do item.

  • urahonkyurahonky Registered User regular
    How do you guys feel about using something like Factory Girl/Boy to generate objects for your tests on the fly? Do you prefer doing each setUp by hand or do you just use a factory to create the items you need?

  • bowenbowen How you doin'? Registered User regular
    urahonky wrote: »
    bowen wrote: »
    urahonky wrote: »
    bowen wrote: »
    This is why doing shit right and not hamstringing people for the illusion of security is a smart idea.

    I was thinking about this. It can't be because of security. If it takes us 8 weeks to do something that should really take 2 weeks then they can bill the Government more time and more money. This gives them more money back since they charge them the contractor rate which is certainly well above how much I was actually making.

    That's certainly a part of it, sure.

    But they can't string them along indefinitely, and the way it was going for you, something that would take a few days was taking you a few months. There's no way that's sustainable. It probably is because US gov't's military budget is intense, but, still, someone will catch on and deliver a faster, better product in half the time and they're fucked.

    If the company has a lot of top secret clearance type stuff, you've likely got a lot of red tape for interoffice stuff that needs to be dealt with like that. Either way, proper security wouldn't impact you in the slightest.

    But we all know the feds are really into security theater.

    Everything I was doing was unclassified materials.

    Probably across the board security requirements by the business to ensure there's no vector that can be exploited. This also minimizes their costs.

    IE, everyone phoned it in when designing procedures.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • crimsoncoyotecrimsoncoyote Registered User regular
    Well, just signed up for a corporate credit card.

    Now is the era for lunches on The Man!

    ...
    ...
    ...
    ok maybe not

    In other news, they are (finally) talking about redoing all our cubicle space with agile in mind. It's only taken 6 months... hopefully they pull the trigger on it sometime soon; my team is scattered throughout 3 different large cubes and it's kind of unacceptable.

  • ecco the dolphinecco the dolphin Registered User regular
    edited March 2015
    ASimPerson wrote: »
    Bold move is, perhaps, a charitable way of putting it. :P

    I've generally found that telling your boss you're leaving too far in advance is a good way to make their lives harder, because they don't know if you're going to be gone in two weeks or two months and have to plan for both situations.

    I personally think that two weeks after getting the offer is a pretty good compromise. Then again, I could definitely see many ways the particulars of your situation are different than here.

    Hahaha, fair enough!

    The thing is, I have to give 'n' days notice before actually leaving (where 'n' is actually a typical value in employment contracts here), and presumably, the replacement also has to give 'n' days notice as well.

    So even if I give notice as soon as I got the offer, there's no practical way that a replacement will get any handover time, given that time is required for interviews etc. The only way I could figure is if I tell them a bit early (which is not the same as giving notice) to give the replacement time to finish off their notice period. =/

    Either way, CVs are being sent out, calls are being placed. We'll see how the local job market is! =)

    ecco the dolphin on
    Penny Arcade Developers at PADev.net.
  • urahonkyurahonky Registered User regular
    urahonky wrote: »
    How do you guys feel about using something like Factory Girl/Boy to generate objects for your tests on the fly? Do you prefer doing each setUp by hand or do you just use a factory to create the items you need?

    The reason I ask is because I'd love to be able to use a factory that generates things using one line of code. But our senior dev is pretty against it. So for our API tests I have to have 20-ish lines of boilerplate code just to log-in. Each api call has probably around 10 tests around it and we have around ~30 API functions.

    So obviously if our login auth changes it'll be a bitch to change all of that code.

  • LD50LD50 Registered User regular
    ASimPerson wrote: »
    Bold move is, perhaps, a charitable way of putting it. :P

    I've generally found that telling your boss you're leaving too far in advance is a good way to make their lives harder, because they don't know if you're going to be gone in two weeks or two months and have to plan for both situations.

    I personally think that two weeks after getting the offer is a pretty good compromise. Then again, I could definitely see many ways the particulars of your situation are different than here.

    Hahaha, fair enough!

    The thing is, I have to give 'n' days notice before actually leaving (where 'n' is actually a typical value in employment contracts here), and presumably, the replacement also has to give 'n' days notice as well.

    So even if I give notice as soon as I got the offer, there's no practical way that a replacement will get any handover time, given that time is required for interviews etc. The only way I could figure is if I tell them a bit early (which is not the same as giving notice) to give the replacement time to finish off their notice period. =/

    Either way, CVs are being sent out, calls are being placed. We'll see how the local job market is! =)

    Good luck!

  • ecco the dolphinecco the dolphin Registered User regular
    urahonky wrote: »
    urahonky wrote: »
    How do you guys feel about using something like Factory Girl/Boy to generate objects for your tests on the fly? Do you prefer doing each setUp by hand or do you just use a factory to create the items you need?

    The reason I ask is because I'd love to be able to use a factory that generates things using one line of code. But our senior dev is pretty against it. So for our API tests I have to have 20-ish lines of boilerplate code just to log-in. Each api call has probably around 10 tests around it and we have around ~30 API functions.

    So obviously if our login auth changes it'll be a bitch to change all of that code.

    Oh man

    In that case, why wouldn't you use a factory?

    It's like saving you time/trouble/bugs of all sorts.

    The mind boggles.

    Penny Arcade Developers at PADev.net.
  • Jimmy KingJimmy King Registered User regular
    edited March 2015
    urahonky wrote: »
    How do you guys feel about using something like Factory Girl/Boy to generate objects for your tests on the fly? Do you prefer doing each setUp by hand or do you just use a factory to create the items you need?

    Factory boy is the way to go. I always use factory boy to generate stuff. it's so much less work when something changes, when you need to generate a bunch of instances of the same model with slightly different data (factory boy can do sequences so a number just increments, random strings, random selections from a set of choices, etc.), when you have an object with a foreign to another object with a foreign key to another object with a foreign key (and so on) you can JUST create the actual object you're testing and have it auto generate all of the related model instances, etc.

    All of my django projects use factory boy, mock, and httpretty heavily for test cases.

    Factory boy also doubles as a great way for generating fake data for dev and staging systems, demos, etc.

    Jimmy King on
  • KambingKambing Registered User regular
    I just posted this in response to someone asking about recursion on the compsci subreddit. I remember someone talking about being confused with recursion in the old thread. This might help clear some stuff up:
    I usually introduce two interpretations of recursion:

    The operational interpretation focuses on how recursive function calls behave. If you understand how recursive calls evaluate, then you can trace through code that uses recursion.

    For example, with a substitutive model of computation, if factorial is defined as:
    factorial 0 = 1
    factorial n = n * factorial n-1
    

    Then the following is how factorial 3 evaluates according to this model:
      factorial 3
    -> 3 * factorial (3-1)
    -> 3 * factorial 2
    -> 3 * (2 * factorial (2-1))
    -> 3 * (2 * factorial 1)
    -> 3 * (2 * (1 * factorial (1-1)))
    -> 3 * (2 * (1 * factorial 0))
    -> 3 * (2 * (1 * 1))
    -> 3 * (2 * 1)
    -> 3 * 2
    -> 6
    

    The key insight is that function calls (in the absence of side-effects) act like arithmetic expressions. They perform some calculation and the result of that calculation is substituted for the function call.

    The semantic interpretation focuses on applying recursive thinking to problem solving. Here, I like to focus on structural recursion and [/i]recursively-defined data[/i] as a stepping stone.

    Consider a recursive definition of a linked list. A linked list is either:

    1. Empty (Nil) or
    2. Non-empty (Cons) with an element at the front of the list followed the rest of the list.

    Now, how might we compute the length of such a list? Rather than using iteration, let's do case analysis on the possible forms of the linked list to see if that helps us make progress:

    1. If the list is empty, then the length is 0.
    2. If the list is non-empty, then we know there is at least one element in the list. So the length must be one plus the length of the rest of the list.

    The length of the rest of the list part is exactly the recursive call, e.g., in Haskell:
    length :: [a] -> Int
    length [] = 0
    length (x:xs) = 1 + length xs
    

    So thinking about solutions recursively comes about by exercising the same decomposition skills you learned when you learned about (non-recursive) functions.

    @TwitchTV, @Youtube: master-level zerg ladder/customs, commentary, and random miscellany.
  • zeenyzeeny Registered User regular
    edited March 2015
    W
    In other news, they are (finally) talking about redoing all our cubicle space with agile in mind. It's only taken 6 months... hopefully they pull the trigger on it sometime soon; my team is scattered throughout 3 different large cubes and it's kind of unacceptable.

    Slack, irc or any online alternative is a better way to improve team communication and get a lot of conversations out in the open than changing furniture "to be agile" (tm).

    zeeny on
  • KakodaimonosKakodaimonos Code fondler Helping the 1% get richerRegistered User regular
    Recursion?

    aw948k87rls3.jpg

  • SpawnbrokerSpawnbroker Registered User regular
    urahonky wrote: »
    Ugh 459 unit tests with coverage takes ~5 minutes to complete.

    Oh boy, your company gives you time for testing. Neat!

    Steam: Spawnbroker
  • urahonkyurahonky Registered User regular
    Yeah I don't think they're quite happy with the idea of us spending an entire sprint to get the unit and functional tests complete. We're already almost 2 months behind schedule. But what we have right now has like 80+ bugs from QA because we omitted testing.

  • crimsoncoyotecrimsoncoyote Registered User regular
    zeeny wrote: »
    W
    In other news, they are (finally) talking about redoing all our cubicle space with agile in mind. It's only taken 6 months... hopefully they pull the trigger on it sometime soon; my team is scattered throughout 3 different large cubes and it's kind of unacceptable.

    Slack, irc or any online alternative is a better way to improve team communication and get a lot of conversations out in the open than changing furniture "to be agile" (tm).

    I don't disagree. The problem is more that half my team doesn't do so well with online communication. It doesn't help that half the time they aren't at their desk either and I have no idea where they are. If we were at least sitting together, I could easily say "X is at lunch"... right now it's just *shrug*. There's also little space for information radiators (and no one on my team uses the online stuff either)

    We also have 6 different teams up here working on different things. There are times it gets loud.

  • urahonkyurahonky Registered User regular
    Are you serious? Can I not reset a session variable using Django's unit tests? Once I set a session variable it is always that through the entire test?
    self.client.session['application'] = 'app_name'
    

    I place that on each of my unit tests, but some unit tests check for invalid application names so I did:
    self.client.session['application'] = 'invalid'
    

    But the code when I do:
    application = request.session.get('application')
    print("application name: " + application)
    

    Always prints 'app_name' no matter what.

  • urahonkyurahonky Registered User regular
    I mean I'm staring at this: https://code.djangoproject.com/ticket/10899 trying to figure out why they're saying it's closed when it clearly doesn't work properly.

  • a5ehrena5ehren AtlantaRegistered User regular
    edited March 2015
    Hrm. For some reason IT maintains a package repo that is an old, incomplete mirror of the distro's, and then disables the real one.

    Now installing this SDK is going to take me at least 2 days instead of 15 minutes. Good job!

    Though I guess these are the same people who decided to use Fedora in a production/development environment and then only upgrade it every 3 years, so I guess it isn't too surprising.

    a5ehren on
  • mightyjongyomightyjongyo Sour Crrm East Bay, CaliforniaRegistered User regular
    a5ehren wrote: »
    Hrm. For some reason IT maintains a package repo that is an old, incomplete mirror of the distro's, and then disables the real one.

    Now installing this SDK is going to take me at least 2 days instead of 15 minutes. Good job!

    Though I guess these are the same people who decided to use Fedora in a production/development environment and then only upgrade it every 3 years, so I guess it isn't too surprising.

    *cough* we totally use fedora on our machines which sit in airports and need to be supported for decades. We still have some machines in the field that run dos. We're hoping to upgrade our fedora 14 systems to fedora 20 in about a year, by which time f22 will be released.

  • a5ehrena5ehren AtlantaRegistered User regular
    Ha. The people who want Red Hat but don't want to pay should be told about CentOS :P

  • urahonkyurahonky Registered User regular
    God this test file is up to 4500 lines and growing.

  • urahonkyurahonky Registered User regular
    self.client.session['application'] = 'Invalid'
    

    Apparently does nothing. The session application was being set by our decorator.

  • zeenyzeeny Registered User regular
    edited March 2015
    zeeny wrote: »
    W
    In other news, they are (finally) talking about redoing all our cubicle space with agile in mind. It's only taken 6 months... hopefully they pull the trigger on it sometime soon; my team is scattered throughout 3 different large cubes and it's kind of unacceptable.

    Slack, irc or any online alternative is a better way to improve team communication and get a lot of conversations out in the open than changing furniture "to be agile" (tm).

    I don't disagree. The problem is more that half my team doesn't do so well with online communication. It doesn't help that half the time they aren't at their desk either and I have no idea where they are. If we were at least sitting together, I could easily say "X is at lunch"... right now it's just *shrug*. There's also little space for information radiators (and no one on my team uses the online stuff either)

    We also have 6 different teams up here working on different things. There are times it gets loud.

    We are a distributed team (several primary locations) and while previously using hangouts/skype, wikis etc once we actually structured our communication it improved tremendously. Being able to ping in a non-engaging manner on a subject has been very positive and having access to product/topic discussions even when you are not directly concerned gives a better overview on what's everybody doing and what issues are faced. It's one of the things where everybody liked it, which is pretty rare.

    zeeny on
  • bowenbowen How you doin'? Registered User regular
    Certification paperwork for ONC certification requires it to be in MSWord format when returned.

    Okay cool.

    *fills out paperwork*

    Wait you want someone's signature...

    ... no I don't think that's going to work, how about I give it to you in PDF format?

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • TofystedethTofystedeth Registered User regular
    Scan it to an image and embed in the word doc?

    steam_sig.png
  • ecco the dolphinecco the dolphin Registered User regular
    Scan it to an imagePhotograph it on a wooden table and embed in the word doc?

    Penny Arcade Developers at PADev.net.
  • bowenbowen How you doin'? Registered User regular
    Scan it to an image and embed in the word doc?

    Yeah I asked if a scanned PDF was acceptable, apparently it is.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • ecco the dolphinecco the dolphin Registered User regular
    Sometimes I wonder if the reason I name my variables relatively verbosely (e.g. rowIndex, pDataBuffer) is an automatic knee-jerk reaction to seeing variables named stuff like mpzhq, ii, hyp.

    Even in context, it is not immediately obvious what they are...

    Penny Arcade Developers at PADev.net.
  • ecco the dolphinecco the dolphin Registered User regular
    Looks like an ioctl() or something that went dramatically off the rails.

    Penny Arcade Developers at PADev.net.
This discussion has been closed.