Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
else:
files = self._get_files()
args = self._get_args()
# the result is a count of the number of errors,
# though I don't think the caller cares.
result = linter.run(args + sorted(files))
# result is the number of errors detected
if result > 0:
message = (
"1 error was detected"
if result == 1
else "{} errors were detected".format(result)
)
raise CumulusCIFailure(message)
pass
class SalesforceException(CumulusCIException):
""" Raise for errors related to Salesforce """
pass
class SalesforceDXException(CumulusCIException):
""" Raise for errors related to Salesforce DX """
pass
class SOQLQueryException(CumulusCIFailure):
""" Raise for errors related to Salesforce DX """
pass
class CommandException(CumulusCIFailure):
""" Raise for errors coming from spawned CLI subprocesses """
pass
class BrowserTestFailure(CumulusCIFailure):
""" Raise when browser tests fail """
pass
pass
class CommandException(CumulusCIFailure):
""" Raise for errors coming from spawned CLI subprocesses """
pass
class BrowserTestFailure(CumulusCIFailure):
""" Raise when browser tests fail """
pass
class ApexCompilationException(CumulusCIFailure):
""" Raise when apex compilation fails """
def __str__(self):
line, problem = self.args
return f"Apex compilation failed on line {line}: {problem}"
class ApexException(CumulusCIFailure):
""" Raise when an Apex Exception is raised in an org """
def __str__(self):
message, stacktrace = self.args
stacktrace = "\n ".join(stacktrace.splitlines())
return f"Apex error: {message}\n Stacktrace:\n {stacktrace}"
class BrowserTestFailure(CumulusCIFailure):
""" Raise when browser tests fail """
pass
class ApexCompilationException(CumulusCIFailure):
""" Raise when apex compilation fails """
def __str__(self):
line, problem = self.args
return f"Apex compilation failed on line {line}: {problem}"
class ApexException(CumulusCIFailure):
""" Raise when an Apex Exception is raised in an org """
def __str__(self):
message, stacktrace = self.args
stacktrace = "\n ".join(stacktrace.splitlines())
return f"Apex error: {message}\n Stacktrace:\n {stacktrace}"
class PushApiObjectNotFound(CumulusCIException):
""" Raise when Salesforce Push API object is not found """
pass
class RobotTestFailure(CumulusCIFailure):
""" Raise when a robot test fails in a test suite """
pass
class AntTargetException(CumulusCIException):
""" Raised when a generic Ant target error occurs """
pass
class DeploymentException(CumulusCIFailure):
""" Raised when a metadata api deployment error occurs """
pass
class ApexTestException(CumulusCIFailure):
""" Raised when a build fails because of an Apex test failure """
pass
class SalesforceCredentialsException(CumulusCIException):
""" Raise when Salesforce credentials are invalid """
pass
class TaskRequiresSalesforceOrg(CumulusCIUsageError):
""" Raise when a task that requires a Salesforce org_config is not initialized with an org_config """
pass
pass
class SalesforceDXException(CumulusCIException):
""" Raise for errors related to Salesforce DX """
pass
class SOQLQueryException(CumulusCIFailure):
""" Raise for errors related to Salesforce DX """
pass
class CommandException(CumulusCIFailure):
""" Raise for errors coming from spawned CLI subprocesses """
pass
class BrowserTestFailure(CumulusCIFailure):
""" Raise when browser tests fail """
pass
class ApexCompilationException(CumulusCIFailure):
""" Raise when apex compilation fails """
def __str__(self):
line, problem = self.args
return "{} for config {}".format(self.message, self.config_name)
class ConfigMergeError(ConfigError):
""" Raised when merging configuration fails. """
pass
class AntTargetException(CumulusCIException):
""" Raised when a generic Ant target error occurs """
pass
class DeploymentException(CumulusCIFailure):
""" Raised when a metadata api deployment error occurs """
pass
class ApexTestException(CumulusCIFailure):
""" Raised when a build fails because of an Apex test failure """
pass
class SalesforceCredentialsException(CumulusCIException):
""" Raise when Salesforce credentials are invalid """
pass
class ApexException(CumulusCIFailure):
""" Raise when an Apex Exception is raised in an org """
def __str__(self):
message, stacktrace = self.args
stacktrace = "\n ".join(stacktrace.splitlines())
return f"Apex error: {message}\n Stacktrace:\n {stacktrace}"
class PushApiObjectNotFound(CumulusCIException):
""" Raise when Salesforce Push API object is not found """
pass
class RobotTestFailure(CumulusCIFailure):
""" Raise when a robot test fails in a test suite """
pass
class BulkDataException(CumulusCIFailure):
""" Raise for errors from bulkdata tasks """
pass
from cumulusci.core.utils import process_bool_arg
from cumulusci.salesforce_api.utils import get_simple_salesforce_connection
from cumulusci.tasks.salesforce import BaseSalesforceApiTask
from cumulusci.tasks.salesforce import Deploy
from cumulusci.tasks.sfdx import SFDXBaseTask
from cumulusci.utils import cd
from cumulusci.utils import download_extract_zip
from cumulusci.utils import download_extract_github
# from cumulusci.utils import temporary_dir
from cumulusci.utils import zip_inject_namespace
from cumulusci.utils import zip_strip_namespace
from cumulusci.utils import zip_tokenize_namespace
class DependencyLookupError(CumulusCIFailure):
pass
class PackageUploadFailure(CumulusCIFailure):
pass
# FIXME: Move to cumulusci.utils
@contextmanager
def temporary_dir(chdir=True):
"""Context manager that creates a temporary directory and chdirs to it.
When the context manager exits it returns to the previous cwd
and deletes the temporary directory.
"""
d = tempfile.mkdtemp()
class BrowserTestFailure(CumulusCIFailure):
""" Raise when browser tests fail """
pass
class ApexCompilationException(CumulusCIFailure):
""" Raise when apex compilation fails """
def __str__(self):
line, problem = self.args
return "Apex compilation failed on line {}: {}".format(line, problem)
class ApexException(CumulusCIFailure):
""" Raise when an Apex Exception is raised in an org """
def __str__(self):
message, stacktrace = self.args
stacktrace = "\n ".join(stacktrace.splitlines())
return "Apex error: {}\n Stacktrace:\n {}".format(message, stacktrace)
class PushApiObjectNotFound(CumulusCIException):
""" Raise when Salesforce Push API object is not found """
pass
class RobotTestFailure(CumulusCIFailure):
""" Raise when a robot test fails in a test suite """