예제 #1
0
    def test_environment(self):
        """
        Make sure we can instantiate an environment and get information about the installed apps and their descriptors.
        """
        env = InstalledEnvironment(
            os.path.join(self.project_config, "env", "simple.yml"),
            self.pipeline_configuration)

        self.assertListEqual(env.get_engines(), ["tk-test"])
        self.assertListEqual(env.get_apps("tk-test"), ["tk-multi-nodep"])
        self.assertListEqual(env.get_frameworks(), [
            "tk-framework-test_v1.0.0", "tk-framework-test_v1.0.x",
            "tk-framework-test_v1.x.x"
        ])

        desc = env.get_framework_descriptor("tk-framework-test_v1.0.0")
        self.assertIsInstance(desc._io_descriptor, TankMockStoreDescriptor)
        self.assertEqual(desc.version, "v1.0.0")

        desc = env.get_engine_descriptor("tk-test")
        self.assertIsInstance(desc._io_descriptor, TankMockStoreDescriptor)
        self.assertEqual(desc.version, "v1.0.0")

        desc = env.get_app_descriptor("tk-test", "tk-multi-nodep")
        self.assertIsInstance(desc._io_descriptor, TankMockStoreDescriptor)
        self.assertEqual(desc.version, "v1.0.0")
예제 #2
0
 def _get_env(self, env_name):
     """
     Retrieves the environment file specified.
     """
     return InstalledEnvironment(
         os.path.join(self.project_config, "env", "%s.yml" % env_name), self.pipeline_configuration
     )
예제 #3
0
    def test_simple_update(self):
        """
        Test Simple update.
        """
        # Run appstore updates.
        command = self.tk.get_command("updates")
        command.set_logger(logging.getLogger("/dev/null"))
        command.execute({"environment_filter": "simple"})

        # Make sure we are v2.
        env = InstalledEnvironment(
            os.path.join(self.project_config, "env", "simple.yml"),
            self.pipeline_configuration)

        desc = env.get_app_descriptor("tk-test", "tk-multi-nodep")
        self.assertEqual(desc.version, "v2.0.0")

        desc = env.get_framework_descriptor("tk-framework-test_v1.0.0")
        self.assertEqual(desc.version, "v1.0.0")

        desc = env.get_framework_descriptor("tk-framework-test_v1.0.x")
        self.assertEqual(desc.version, "v1.0.1")

        desc = env.get_framework_descriptor("tk-framework-test_v1.x.x")
        self.assertEqual(desc.version, "v1.1.0")
예제 #4
0
    def test_simple_update(self):
        """
        Test Simple update.
        """
        # Run appstore updates.
        command = self.tk.get_command("updates")
        command.set_logger(logging.getLogger("/dev/null"))
        command.execute({"environment_filter": "simple"})

        # Make sure we are v2.
        env = InstalledEnvironment(os.path.join(self.project_config, "env", "simple.yml"), self.pipeline_configuration)

        desc = env.get_app_descriptor("tk-test", "tk-multi-nodep")
        self.assertEqual(desc.version, "v2.0.0")

        desc = env.get_framework_descriptor("tk-framework-test_v1.0.0")
        self.assertEqual(desc.version, "v1.0.0")

        desc = env.get_framework_descriptor("tk-framework-test_v1.0.x")
        self.assertEqual(desc.version, "v1.0.1")

        desc = env.get_framework_descriptor("tk-framework-test_v1.x.x")
        self.assertEqual(desc.version, "v1.1.0")
예제 #5
0
    def test_environment(self):
        """
        Make sure we can instantiate an environment and get information about the installed apps and their descriptors.
        """
        env = InstalledEnvironment(os.path.join(self.project_config, "env", "simple.yml"), self.pipeline_configuration)

        self.assertListEqual(env.get_engines(), ["tk-test"])
        self.assertListEqual(env.get_apps("tk-test"), ["tk-multi-nodep"])
        self.assertListEqual(
            env.get_frameworks(),
            ["tk-framework-test_v1.0.0", "tk-framework-test_v1.0.x", "tk-framework-test_v1.x.x"]
        )

        desc = env.get_framework_descriptor("tk-framework-test_v1.0.0")
        self.assertIsInstance(desc._io_descriptor, TankMockStoreDescriptor)
        self.assertEqual(desc.version, "v1.0.0")

        desc = env.get_engine_descriptor("tk-test")
        self.assertIsInstance(desc._io_descriptor, TankMockStoreDescriptor)
        self.assertEqual(desc.version, "v1.0.0")

        desc = env.get_app_descriptor("tk-test", "tk-multi-nodep")
        self.assertIsInstance(desc._io_descriptor, TankMockStoreDescriptor)
        self.assertEqual(desc.version, "v1.0.0")
예제 #6
0
    def test_simple_update(self):
        """
        Test Simple update.
        """
        # Run appstore updates.
        command = self.tk.get_command("updates")
        command.set_logger(logging.getLogger("/dev/null"))
        results = command.execute({"environment_filter": "simple"})

        # The expected results in this situation are the same between python 2 and 3,
        # but if the environment is changed with future updates, then this may not be the
        # case. See `test_update_include` for more details.
        expected_results = [
            {
                "environment": "simple",
                "app_instance": None,
                "updated": False,
                "engine_instance": "tk-test",
                "framework_name": None,
            },
            {
                "app_instance": "tk-multi-nodep",
                "updated": True,
                "engine_instance": "tk-test",
                "new_version": "v2.0.0",
                "framework_name": None,
                "environment": "simple",
            },
            {
                "environment": "simple",
                "app_instance": None,
                "updated": False,
                "engine_instance": None,
                "framework_name": "tk-framework-test_v1.0.0",
            },
            {
                "app_instance": None,
                "updated": True,
                "engine_instance": None,
                "new_version": "v1.0.1",
                "framework_name": "tk-framework-test_v1.0.x",
                "environment": "simple",
            },
            {
                "app_instance": None,
                "updated": True,
                "engine_instance": None,
                "new_version": "v1.1.0",
                "framework_name": "tk-framework-test_v1.x.x",
                "environment": "simple",
            },
        ]

        # Check the results returned by the update command
        self.assertListEqual(results, expected_results)

        # Make sure we are v2.
        env = InstalledEnvironment(
            os.path.join(self.project_config, "env", "simple.yml"),
            self.pipeline_configuration,
        )

        desc = env.get_app_descriptor("tk-test", "tk-multi-nodep")
        self.assertEqual(desc.version, "v2.0.0")

        desc = env.get_framework_descriptor("tk-framework-test_v1.0.0")
        self.assertEqual(desc.version, "v1.0.0")

        desc = env.get_framework_descriptor("tk-framework-test_v1.0.x")
        self.assertEqual(desc.version, "v1.0.1")

        desc = env.get_framework_descriptor("tk-framework-test_v1.x.x")
        self.assertEqual(desc.version, "v1.1.0")