Skip to content

CI runs on production server #392

Closed
Closed

Description

@joaquinvanschoren

It looks like something is wrong with the unit tests, because they upload runs to the production server: https://www.openml.org/r/8857778

Please don't :). Unless these experiments are actually useful?

Activity

  1. joaquinvanschoren commented on Mar 7, 2018

    @joaquinvanschoren
    ContributorAuthor

    @janvanrijn @mfeurer can you take a look at this? I'm still seeing lots of CI runs streaming in on production...

  2. mfeurer commented on Mar 7, 2018

    @mfeurer
    Collaborator

    @ArlindKadra could you please prioritize this?

  3. ArlindKadra commented on Mar 7, 2018

    @ArlindKadra
    Member

    @joaquinvanschoren @mfeurer sure thing. I found out the problem.

  4. joaquinvanschoren commented on Mar 7, 2018

    @joaquinvanschoren
    ContributorAuthor

    Thanks!

  5. ArlindKadra commented on Mar 7, 2018

    @ArlindKadra
    Member

    @mfeurer The problem is in the OpenML_Tutorial.ipynb at tests/test_examples/. We are uploading runs to the production server with Travis.

  6. joaquinvanschoren commented on Mar 7, 2018

    @joaquinvanschoren
    ContributorAuthor
  7. ArlindKadra commented on Mar 7, 2018

    @ArlindKadra
    Member

    Yeah sure, we can go with the first option.

  8. mfeurer commented on Mar 13, 2018

    @mfeurer
    Collaborator

    After @ArlindKadra figured this out I had a brief look at how we could tackle this. All this is based on the premise that we have examples and tutorials in CI to make sure that they keep on working (which rules out the option to comment out code in the tutorial).

    1. Work only on the test server. This appears to be pretty boring as there aren't a lot of results for tasks.
    2. Only do the uploads to the test server, however, we would not get them if we download all previous results from the live server.
    3. Split up the tutorial page into several smaller tutorials in which analysis of runs and upload of runs are separate scripts. Then we could redirect the uploads to the test server without making the other example boring.

    @joaquinvanschoren what do you think about the last solution? You would need to use separate notebooks for presentation then.

  9. janvanrijn commented on Mar 13, 2018

    @janvanrijn
    Member
  10. mfeurer commented on Mar 13, 2018

    @mfeurer
    Collaborator

    Wouldn't that give an exception?

  11. janvanrijn commented on Mar 13, 2018

    @janvanrijn
    Member

    One that you can predict and potentially catch

  12. mfeurer commented on Mar 14, 2018

    @mfeurer
    Collaborator

    Yes, but one would have to catch that either outside of the notebook (and therefore not fully test it). I also think that we mock out the upload calls. Then the notebook will behave like before, there just will be no runs on the live server.

  13. joaquinvanschoren commented on Mar 14, 2018

    @joaquinvanschoren
    ContributorAuthor
  14. 3 remaining items

  15. joaquinvanschoren commented on Mar 25, 2018

    @joaquinvanschoren
    ContributorAuthor

    FYI, this is still happening.
    Can we do the testing without uploading test runs to the production server?

  16. mfeurer commented on Mar 29, 2018

    @mfeurer
    Collaborator

    No one had time so far to do something about this. I just tried this, but the solution using unittest.mock did not work (see below for a snippet). I will have to check this next Tuesday.

        @mock.patch('openml._api_calls._perform_api_call')
        def test_tutorial(self, patch):
            def side_effect(*args, **kwargs):
                if (
                    args[0].endswith('/run/')
                    and kwargs['file_elements'] is not None
                ):
                    raise ValueError('Not uploading a run!')
                else:
                    return mock.DEFAULT
            patch.side_effect = side_effect
            self._test_notebook('OpenML_Tutorial.ipynb', patch)
            self.assertEqual(patch.call_count, 2)
    
  17. mfeurer commented on Apr 3, 2018

    @mfeurer
    Collaborator

    I just opened a PR at #430.

  18. added a commit that references this issue on Apr 6, 2018
  19. mfeurer commented on Apr 6, 2018

    @mfeurer
    Collaborator

    Fixed via #430.

  20. joaquinvanschoren commented on Dec 13, 2018

    @joaquinvanschoren
    ContributorAuthor

    It's happening again:
    https://www.openml.org/r/9912434

  21. mfeurer commented on Dec 17, 2018

    @mfeurer
    Collaborator

    Hm, I can't reproduce this locally... @ArlindKadra could you please look into this?

  22. ArlindKadra commented on Dec 18, 2018

    @ArlindKadra
    Member

    @mfeurer It is from the recent pull request regarding flows that was merged into development.

    def test_openml_param_name_to_sklearn(self):
    scaler = sklearn.preprocessing.StandardScaler(with_mean=False)
    boosting = sklearn.ensemble.AdaBoostClassifier(
    base_estimator=sklearn.tree.DecisionTreeClassifier())
    model = sklearn.pipeline.Pipeline(steps=[
    ('scaler', scaler), ('boosting', boosting)])
    flow = openml.flows.sklearn_to_flow(model)
    task = openml.tasks.get_task(115)
    run = openml.runs.run_flow_on_task(flow, task)
    run = run.publish()
    run = openml.runs.get_run(run.run_id)
    setup = openml.setups.get_setup(run.setup_id)

    The class does not extend OpenML's TestCase but the unittest one. That is why it is publishing at the main server.

    class TestSklearn(unittest.TestCase):

  23. ArlindKadra commented on Dec 18, 2018

    @ArlindKadra
    Member

    @mfeurer A solution is:
    setting the config.server to the production server in the setup
    changing the config.server to the test server in the test_openml_param_name_to_sklearn unittest

  24. mfeurer commented on Dec 19, 2018

    @mfeurer
    Collaborator

    Thanks @ArlindKadra for checking. I just created PR #609 to subclass all test cases from OpenML's core test case which hopefully fixes this issue.

  25. ArlindKadra commented on Dec 19, 2018

    @ArlindKadra
    Member

    @mfeurer that is actually better, I am surprised that the sklearn tests did not make use of any tasks from the production server.

  26. mfeurer commented on Jan 29, 2019

    @mfeurer
    Collaborator

    Okay fixed again via #609.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions