Exemple #1
0
def test_search_boot_tests():
    tel = telemetry.ingest(server=server)
    tel.use_test_index = True
    inputs = {
        "boot_folder_name": "zynq-adrv9361-z7035-bob",
        "hdl_hash": "ecd880d44cdd000691283f2edbd31aa52d6ccc3e",
        "linux_hash": "b0cb7c3bfd1fec02b1671b061112cd2551a9b340",
        "hdl_branch": "hdl_2019_r2",
        "linux_branch": "2019_R2",
        "is_hdl_release": True,
        "is_linux_release": True,
        "uboot_reached": True,
        "linux_prompt_reached": True,
        "drivers_enumerated": True,
        "dmesg_warnings_found": False,
        "dmesg_errors_found": False,
        "jenkins_job_date": datetime.datetime.now(),  # "Dec 31, 2020 @ 13:47:04.129",
        "jenkins_build_number": 34,
        "jenkins_project_name": "pyadi-iio-hw",
        "jenkins_agent": "master",
    }

    tel.log_boot_tests(**inputs)
    time.sleep(2)
    inputs["boot_folder_name"] = "zynq-adrv9361-z7035-fmc"
    tel.log_boot_tests(**inputs)
    time.sleep(2)
    tel = telemetry.searches(server=server)
    tel.use_test_index = True
    res = tel.boot_tests(inputs["boot_folder_name"])
    tel.db.delete_index()
    assert len(res) == 2
    assert "zynq-adrv9361-z7035-fmc" in res.keys()
    assert "zynq-adrv9361-z7035-bob" in res.keys()
Exemple #2
0
def test_search_tx_quad_cal_chan1():
    tel = telemetry.ingest(server=server)
    tel.use_test_index = True
    tel.log_ad9361_tx_quad_cal_test("test1", "pluto", 4, 100, 0)
    time.sleep(2)
    tel = telemetry.searches(server=server)
    tel.use_test_index = True
    x, y, t = tel.ad9361_tx_quad_cal_test(channel=1)
    tel.db.delete_index()
    assert y == []
    assert t == []
    assert x == []
Exemple #3
0
def test_search_github_stats():
    tel = telemetry.ingest(server=server)
    tel.use_test_index = True
    tel.log_github_stats("TransceiverToolbox", 1, 2, 3, 4)
    time.sleep(2)
    tel = telemetry.searches(server=server)
    tel.use_test_index = True
    stats = tel.github_stats()
    tel.db.delete_index()
    for k in stats:
        assert k == "TransceiverToolbox"
    assert stats["TransceiverToolbox"]["views"] == 1
    assert stats["TransceiverToolbox"]["clones"] == 2
    assert stats["TransceiverToolbox"]["view_unique"] == 3
    assert stats["TransceiverToolbox"]["clones_unique"] == 4
Exemple #4
0
def test_search_github_release_stats():
    tel = telemetry.ingest(server=server)
    tel.use_test_index = True
    rd = datetime.datetime.now()
    tel.log_github_release_stats("TransceiverToolbox", "v19.2.1", 1024, rd)
    time.sleep(2)
    tel = telemetry.searches(server=server)
    tel.use_test_index = True
    stats = tel.github_release_stats()
    tel.db.delete_index()

    s = datetime.datetime.strptime(
        stats["TransceiverToolbox"]["release_date"], "%Y-%m-%dT%H:%M:%S.%f"
    )

    for k in stats:
        assert k == "TransceiverToolbox"
    assert stats["TransceiverToolbox"]["tag"] == "v19.2.1"
    assert stats["TransceiverToolbox"]["downloads"] == 1024
    assert s == rd
def get_data(device):

    fig = go.Figure()
    tel = telemetry.searches()
    for chan in range(2):
        x, y, t = tel.ad9361_tx_quad_cal_test(channel=chan)

        y = [y[k] / t[k] for k in range(len(y))]
        fig.add_trace(
            go.Scatter(x=x,
                       y=y,
                       mode="lines+markers",
                       name="Channel " + str(chan)))

    fig.update_xaxes(title_text="Date",
                     title_font={"size": 20},
                     title_standoff=25)
    fig.update_yaxes(title_text="Calibration Failure (%)",
                     title_font={"size": 20},
                     title_standoff=25)
    return fig