Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-14124

scons --clean does not remove pytest cache

    XMLWordPrintable

    Details

      Description

      When I run scons --clean and then scons, pytest doesn't always run all the tests. I have to manually delete the .cache/ directory. scons --clean should remove the pytest .cache/ directory, so that pytest always runs all tests after scons has cleaned up.

        Attachments

          Issue Links

            Activity

            Hide
            jsick Jonathan Sick added a comment -

            Heads-up that in pytest. 3.4.0 the .cache directory is being renamed to .pytest_cache, so be sure to cover both names.

            Show
            jsick Jonathan Sick added a comment - Heads-up that in pytest. 3.4.0 the .cache directory is being renamed to .pytest_cache , so be sure to cover both names.
            Hide
            tjenness Tim Jenness added a comment -

            Line 114 of scripts.py looks like a plausible place to start.

            Show
            tjenness Tim Jenness added a comment - Line 114 of scripts.py looks like a plausible place to start.
            Hide
            Parejkoj John Parejko added a comment -

            When scons --clean does the "scons: Cleaning targets ..." step, where does it get its list from? Adding ./.cache to the list of things to remove when cleaning the tests target seems like the ideal solution; modifying CleanTree is not as trivial as I'd hoped.

            Show
            Parejkoj John Parejko added a comment - When scons --clean does the "scons: Cleaning targets ..." step, where does it get its list from? Adding ./.cache to the list of things to remove when cleaning the tests target seems like the ideal solution; modifying CleanTree is not as trivial as I'd hoped.
            Hide
            Parejkoj John Parejko added a comment -

            Jim Bosch This is a possible solution, but I think it'd be better if we could do it as part of the "Cleaning targets" step, as I asked about in the comment above. Suggestions welcome, but I believe this does work as implemented.

            Note: I initially accidentally pushed to master, but immediately reverted it.

            Show
            Parejkoj John Parejko added a comment - Jim Bosch This is a possible solution, but I think it'd be better if we could do it as part of the "Cleaning targets" step, as I asked about in the comment above. Suggestions welcome, but I believe this does work as implemented. Note: I initially accidentally pushed to master, but immediately reverted it.
            Hide
            jbosch Jim Bosch added a comment -

            I suspect we can't do this as part of cleaning targets unless we can predict all of the actual files all of our build targets create, and that isn't worth it.

            If it works (I have not tested it), the code is fine.

            Show
            jbosch Jim Bosch added a comment - I suspect we can't do this as part of cleaning targets unless we can predict all of the actual files all of our build targets create, and that isn't worth it. If it works (I have not tested it), the code is fine.
            Hide
            Parejkoj John Parejko added a comment -

            Thanks for the review. It does delete the pytest cache, but I don't know how to check whether it deletes anything else.

            Once we upgrade pytest to >3.4.0, we could remove the ".cache" portion. I'll make a ticket to remind us.

            Merged and done.

            Show
            Parejkoj John Parejko added a comment - Thanks for the review. It does delete the pytest cache, but I don't know how to check whether it deletes anything else. Once we upgrade pytest to >3.4.0, we could remove the ".cache" portion. I'll make a ticket to remind us. Merged and done.

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              Parejkoj John Parejko
              Reviewers:
              Jim Bosch
              Watchers:
              Jim Bosch, John Parejko, John Swinbank, Jonathan Sick, Kian-Tat Lim, Tim Jenness
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.