Esempio n. 1
0
        private static IEnumerable <GdbObjRefMsg> GetDeletableAllowedErrorRefs(
            VerificationParametersMsg requestParameters,
            BackgroundVerificationService qaService)
        {
            // Add invalidated allowed errors to be deleted
            if (requestParameters.ReportInvalidExceptions)
            {
                foreach (AllowedError allowedError in qaService.GetInvalidatedAllowedErrors())
                {
                    yield return(GetGdbObjRefMsg(allowedError));
                }
            }

            if (requestParameters.ReportUnusedExceptions)
            {
                foreach (AllowedError allowedError in qaService.GetUnusedAllowedErrors())
                {
                    yield return(GetGdbObjRefMsg(allowedError));
                }
            }
        }
Esempio n. 2
0
        private ServiceCallStatus VerifyStandaloneXmlCore(
            StandaloneVerificationRequest request,
            IServerStreamWriter <StandaloneVerificationResponse> responseStream,
            ITrackCancel trackCancel)
        {
            // Machine login
            SetupUserNameProvider(Environment.UserName);

            try
            {
                VerificationParametersMsg parameters = request.Parameters;

                IGeometry perimeter =
                    ProtobufGeometryUtils.FromShapeMsg(parameters.Perimeter);

                XmlBasedVerificationService qaService = new XmlBasedVerificationService(
                    HtmlReportTemplatePath, QualitySpecificationTemplatePath);

                XmlQualitySpecificationMsg xmlSpecification = request.Specification;

                var dataSources = new List <DataSource>();
                foreach (string replacement in xmlSpecification.DataSourceReplacements)
                {
                    List <string> replacementStrings = StringUtils.SplitAndTrim(replacement, '|');
                    Assert.AreEqual(2, replacementStrings.Count,
                                    "Data source workspace is not of the format \"workspace_id | catalog_path\"");

                    var dataSource = new DataSource(replacementStrings[0], replacementStrings[0])
                    {
                        WorkspaceAsText = replacementStrings[1]
                    };

                    dataSources.Add(dataSource);
                }

                var aoi = perimeter == null ? null : new AreaOfInterest(perimeter);

                try
                {
                    qaService.ExecuteVerification(
                        xmlSpecification.Xml,
                        xmlSpecification.SelectedSpecificationName,
                        dataSources, aoi, null, parameters.TileSize,
                        request.OutputDirectory, IssueRepositoryType.FileGdb,
                        true, trackCancel);
                }
                catch (ArgumentException argumentException)
                {
                    _msg.Warn("Argument exception", argumentException);

                    return(ServiceCallStatus.Failed);
                }
            }
            catch (Exception e)
            {
                _msg.DebugFormat("Error during processing of request {0}", request);
                _msg.Error($"Error verifying quality: {e.Message}", e);

                if (!EnvironmentUtils.GetBooleanEnvironmentVariableValue(
                        "PROSUITE_QA_SERVER_KEEP_SERVING_ON_ERROR"))
                {
                    SetUnhealthy();
                }

                return(ServiceCallStatus.Failed);
            }

            return(trackCancel.Continue()
                                       ? ServiceCallStatus.Finished
                                       : ServiceCallStatus.Cancelled);
        }