Example #1
0
    def run_cmd(self):
        query_limit = 100
        num_to_display = 50
        branch = 'master'
        project_names = self.get_project_names()
        extracted_distro_locations = {'new': '/tmp/distro_new', 'old': '/tmp/distro_old'}

        new_changes = Changes(branch, extracted_distro_locations['new'], num_to_display,
                              query_limit, project_names, self.remote_url)

        new_projects = new_changes.run_cmd()
        new_changes.pretty_print_projects(new_projects)

        old_changes = Changes(branch, extracted_distro_locations['old'], num_to_display,
                              query_limit, project_names, self.remote_url)

        old_projects = old_changes.run_cmd()
        old_changes.pretty_print_projects(old_projects)

        patchset_diff = []
        print("\nPatch differences:\n------------------")
        for project_name, values in new_projects.items():
            new_gerrits = values['includes']
            for gerrit in new_gerrits:
                if gerrit not in old_projects[project_name]['includes']:
                    patchset_diff.append(gerrit)
                    print('{:<20}{}\t{}'.format(project_name, gerrit['url'], gerrit['subject']))

        print("\n%s different patches between the two distros." % len(patchset_diff))
    def run_cmd(self):
        query_limit = 100
        num_to_display = 50
        branch = "master"
        project_names = self.get_project_names()
        extracted_distro_locations = {
            "new": "/tmp/distro_new",
            "old": "/tmp/distro_old",
        }

        new_changes = Changes(
            branch,
            extracted_distro_locations["new"],
            num_to_display,
            query_limit,
            project_names,
            self.remote_url,
        )

        new_projects = new_changes.run_cmd()
        new_changes.pretty_print_projects(new_projects)

        old_changes = Changes(
            branch,
            extracted_distro_locations["old"],
            num_to_display,
            query_limit,
            project_names,
            self.remote_url,
        )

        old_projects = old_changes.run_cmd()
        old_changes.pretty_print_projects(old_projects)

        patchset_diff = []
        print("\nPatch differences:\n------------------")
        for project_name, values in new_projects.items():
            new_gerrits = values["includes"]
            for gerrit in new_gerrits:
                if gerrit not in old_projects[project_name]["includes"]:
                    patchset_diff.append(gerrit)
                    print(
                        "{:<20}{}\t{}".format(
                            project_name, gerrit["url"], gerrit["subject"]
                        )
                    )

        print("\n%s different patches between the two distros." % len(patchset_diff))
Example #3
0
 def test_pretty_print(self):
     project_names = PROJECT_NAMES
     changes = Changes(BRANCH, DISTRO_PATH, LIMIT, QLIMIT, project_names,
                       REMOTE_URL)
     projects = {}
     for project in project_names:
         projects[project] = {"commit": 1, "includes": [{'a': 1}]}
     changes.pretty_print_projects(projects)
     for project in project_names:
         projects[project] = {
             "commit":
             1,
             "includes": [{
                 "grantedOn": 1,
                 "lastUpdated": 11,
                 "number": "12345",
                 "subject": "This is a test for " + project
             }, {
                 "grantedOn": 2,
                 "lastUpdated": 22,
                 "number": "56789",
                 "subject": "This is a test for " + project
             }]
         }
     changes.pretty_print_projects(projects)
Example #4
0
 def run_cmd(branch,
             distro_patch,
             limit,
             qlimit,
             project_names,
             remote_url,
             loglevel=0):
     changes = Changes(branch, distro_patch, limit, qlimit, project_names,
                       remote_url, loglevel)
     projects = changes.run_cmd()
     changes.pretty_print_projects(projects)
Example #5
0
 def test_epoch_to_utc(self):
     project_names = PROJECT_NAMES
     changes = Changes(BRANCH, DISTRO_PATH, LIMIT, QLIMIT, project_names,
                       REMOTE_URL)
     print("utc: %s" % changes.epoch_to_utc(1483974872))
Example #6
0
                    .format(vertex.id, prop.key, prop.value))
                vertex_id, props = self.recv_vertex()
                if vertex_id != vertex.id:
                    print("[-] property_is fail")
                    return False
        return True

    def check_graph(self, graph):
        return self.check_graph_vertices(graph) and \
               self.check_graph_edges(graph) and \
               self.check_properties(graph)


print("SEED={}".format(SEED))
print("LENGTH={}".format(LENGTH))

for i in range(LENGTH):
    print("[i] i = {}".format(i))
    num_changes = random.randint(1, 100)

    client = Client(HOST, PORT)
    graph = Graph()
    for i in range(num_changes):
        changes = Changes(graph)
        client.apply_changes(changes)
        if not client.check_graph(graph):
            print("check graph failed")
            sys.exit(-1)

client.exit()
sys.exit(0)
Example #7
0
from raco import Raco
from cpds import Cpds
from progress import Progress
from source import Source
from changes import Changes
from tmiri import Tmiri
import json

with open('config.json','r') as f:
	config = json.load(f)

progress = Progress()
changes = Changes()

sources = [
	Tmiri(config, progress, changes),
	Cpds(config, progress, changes),
	Raco(config, progress, changes)
]

for source in sources:
	source.update()

progress.end()

changes.status()

#for source in sources:
#	source.status()