コード例 #1
0
ファイル: tests.py プロジェクト: toffer/raven-python
def test_fetch_git_sha():
    result = fetch_git_sha(settings.PROJECT_ROOT)
    assert result is not None
    assert len(result) == 40
    assert isinstance(result, six.string_types)
    assert result == check_output(
        'git rev-parse --verify HEAD', shell=True,
        cwd=settings.PROJECT_ROOT).decode('latin1').strip()
コード例 #2
0
ファイル: tests.py プロジェクト: simudream/raven-python
def test_fetch_git_sha():
    result = fetch_git_sha(settings.PROJECT_ROOT)
    assert result is not None
    assert len(result) == 40
    assert isinstance(result, six.string_types)
    assert result == check_output(
        'git rev-parse --verify HEAD', shell=True, cwd=settings.PROJECT_ROOT
    ).decode('latin1').strip()
コード例 #3
0
ファイル: tests.py プロジェクト: yhl714387953/raven-python
def test_fetch_git_sha(project_root):
    result = fetch_git_sha(project_root)
    assert result is not None
    assert len(result) == 40
    assert isinstance(result, string_types)
    assert result == check_output('git rev-parse --verify HEAD',
                                  shell=True,
                                  cwd=project_root).decode('latin1').strip()
コード例 #4
0
ファイル: tests.py プロジェクト: felixxm/raven-python
def test_fetch_git_sha(project_root):
    result = fetch_git_sha(project_root)
    assert result is not None
    assert len(result) == 40
    assert isinstance(result, string_types)
    assert result == check_output(
        'git rev-parse --verify HEAD', shell=True, cwd=project_root
    ).decode('latin1').strip()
コード例 #5
0
async def test_current_hash(bot_repo):
    branch = await bot_repo.current_branch()
    bot_repo.branch = branch

    commit = await bot_repo.current_commit()

    sentry_sha = fetch_git_sha(str(bot_repo.folder_path))

    assert sentry_sha == commit
コード例 #6
0
def get_status():
  try:
    sha = fetch_git_sha(os.path.join(current_app.root_path, "../../"))
  except:
    sha = "no-git"

  json = {
    "data": {
      "sha": sha
    }
  }
  resp = make_response(jsonify(json), 200)
  resp.mimetype = "application/json"
  return resp
コード例 #7
0
ファイル: sentry.py プロジェクト: statgen/LDServer
def init_app(app):
    # Start logging errors
    try:
        sha = fetch_git_sha(os.path.join(app.root_path, "../../"))
    except:
        sha = "no-git"

    release = "raremetal-server@{}".format(sha)

    sentry_dsn = app.config.get("SENTRY_DSN")
    if sentry_dsn is not None:
        app.config["SENTRY_CONFIG"] = {"dsn": sentry_dsn, "release": release}

        if app.config["SENTRY_ENV"] is not None:
            app.config["SENTRY_CONFIG"]["environment"] = app.config[
                "SENTRY_ENV"]

        # This attaches sentry to current_app.extensions['sentry']
        Sentry(app, register_signal=False, wrap_wsgi=False)
コード例 #8
0
ファイル: sentry.py プロジェクト: statgen/locuszoom-api
def get_sentry():
    global sentry

    # Start logging errors
    sha = fetch_git_sha(os.path.join(current_app.root_path, "../../"))
    release = f"locuszoom-api@{sha}"

    if sentry is None:
        if "SENTRY_DSN" in current_app.config:
            print("Sentry DSN found, attaching to app")
            current_app.config["SENTRY_CONFIG"] = {
                "dsn": current_app.config["SENTRY_DSN"],
                "release": release,
                "environment": current_app.config["LZAPI_MODE"]
            }
            sentry = Sentry(current_app,
                            register_signal=False,
                            wrap_wsgi=False)
        else:
            print("Warning: Sentry DSN not found, skipping")
    else:
        print("Sentry already attached to app")

    return sentry
コード例 #9
0
ファイル: tests.py プロジェクト: jmagnusson/raven-python
def test_fetch_git_sha():
    result = fetch_git_sha(settings.PROJECT_ROOT)
    assert result is not None
    assert len(result) == 40
    assert isinstance(result, six.string_types)
コード例 #10
0
ファイル: tests.py プロジェクト: klinskih/raven-python
def test_fetch_git_sha():
    result = fetch_git_sha(settings.PROJECT_ROOT)
    assert result is not None
    assert len(result) == 40
    assert isinstance(result, six.string_types)