Exemplo n.º 1
0
        public void AddResult(int revisionwork_id, int lane_id, int host_id, int revision_id, string status, string known_failure, bool crashed, int workfile_id, int command_id)
        {
            TestRevision r;
            DBRevision dbr = Settings.GetRevisions ().SingleOrDefault (rev => rev.id == revision_id);
            string revision = dbr == null ? revision_id.ToString () : dbr.revision;

            r = FindRevision (revision);
            if (r == null) {
                r = new TestRevision ();
                r.RevisionId = revision_id;
                r.Revision = revision;
                Revisions.Add (r);
            }

            // Remove any existing results we've already parsed
            List<TestResult> to_be_removed = new List<TestResult> (r.Results.Where (tres => tres.WorkFileId == workfile_id));
            foreach (TestResult tres in to_be_removed ) {
                r.Results.Remove (tres);
            }

            TestResult tr = new TestResult ();
            tr.Status = status;
            tr.KnownFailure = known_failure;
            tr.LaneId = lane_id;
            tr.HostId = host_id;
            tr.RevisionId = revision_id;
            tr.RevisionWorkId = revisionwork_id;
            tr.Crashed = crashed;
            tr.WorkFileId = workfile_id;
            tr.CommandId = command_id;
            r.Results.Add (tr);
        }
Exemplo n.º 2
0
        public void AddResult(int revisionwork_id, int lane_id, int host_id, int revision_id, string status, string known_failure, bool crashed, int workfile_id, int command_id)
        {
            TestRevision r;
            DBRevision   dbr      = Settings.GetRevisions().SingleOrDefault(rev => rev.id == revision_id);
            string       revision = dbr == null?revision_id.ToString() : dbr.revision;

            r = FindRevision(revision);
            if (r == null)
            {
                r            = new TestRevision();
                r.RevisionId = revision_id;
                r.Revision   = revision;
                Revisions.Add(r);
            }

            // Remove any existing results we've already parsed
            List <TestResult> to_be_removed = new List <TestResult> (r.Results.Where(tres => tres.WorkFileId == workfile_id));

            foreach (TestResult tres in to_be_removed)
            {
                r.Results.Remove(tres);
            }

            TestResult tr = new TestResult();

            tr.Status         = status;
            tr.KnownFailure   = known_failure;
            tr.LaneId         = lane_id;
            tr.HostId         = host_id;
            tr.RevisionId     = revision_id;
            tr.RevisionWorkId = revisionwork_id;
            tr.Crashed        = crashed;
            tr.WorkFileId     = workfile_id;
            tr.CommandId      = command_id;
            r.Results.Add(tr);
        }