Fix benchmark rates not using floats; add oreo and david's pc
This commit is contained in:
parent
8567c629cb
commit
42c5bee947
|
@ -28,7 +28,7 @@ class Dummy:
|
||||||
ET = (
|
ET = (
|
||||||
('A0000000000001', 'DT-AAAAA'),
|
('A0000000000001', 'DT-AAAAA'),
|
||||||
('A0000000000002', 'DT-BBBBB'),
|
('A0000000000002', 'DT-BBBBB'),
|
||||||
('A0000000000002', 'DT-CCCCC'),
|
('A0000000000003', 'DT-CCCCC'),
|
||||||
)
|
)
|
||||||
"""eTags to create."""
|
"""eTags to create."""
|
||||||
ORG = 'eReuse.org CAT', '-t', 'G-60437761', '-c', 'ES'
|
ORG = 'eReuse.org CAT', '-t', 'G-60437761', '-c', 'ES'
|
||||||
|
@ -119,9 +119,9 @@ class Dummy:
|
||||||
assert len(inventory['items'])
|
assert len(inventory['items'])
|
||||||
|
|
||||||
i, _ = user.get(res=Device, query=[('search', 'intel')])
|
i, _ = user.get(res=Device, query=[('search', 'intel')])
|
||||||
assert len(i['items']) == 11
|
|
||||||
i, _ = user.get(res=Device, query=[('search', 'pc')])
|
|
||||||
assert len(i['items']) == 12
|
assert len(i['items']) == 12
|
||||||
|
i, _ = user.get(res=Device, query=[('search', 'pc')])
|
||||||
|
assert len(i['items']) == 13
|
||||||
|
|
||||||
# Let's create a set of events for the pc device
|
# Let's create a set of events for the pc device
|
||||||
# Make device Ready
|
# Make device Ready
|
||||||
|
|
|
@ -154,7 +154,7 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
{"id": "A0000000000002", "type": "Tag"}
|
{"id": "A0000000000003", "type": "Tag"}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"version": "11.0a6",
|
"version": "11.0a6",
|
||||||
|
|
|
@ -10,7 +10,7 @@ from boltons import urlutils
|
||||||
from citext import CIText
|
from citext import CIText
|
||||||
from flask import current_app as app, g
|
from flask import current_app as app, g
|
||||||
from sqlalchemy import BigInteger, Boolean, CheckConstraint, Column, DateTime, Enum as DBEnum, \
|
from sqlalchemy import BigInteger, Boolean, CheckConstraint, Column, DateTime, Enum as DBEnum, \
|
||||||
Float, ForeignKey, Interval, JSON, Numeric, SmallInteger, Unicode, event, orm
|
Float, ForeignKey, Interval, JSON, Numeric, SmallInteger, Unicode, event, orm, Integer
|
||||||
from sqlalchemy.dialects.postgresql import UUID
|
from sqlalchemy.dialects.postgresql import UUID
|
||||||
from sqlalchemy.ext.declarative import declared_attr
|
from sqlalchemy.ext.declarative import declared_attr
|
||||||
from sqlalchemy.ext.orderinglist import ordering_list
|
from sqlalchemy.ext.orderinglist import ordering_list
|
||||||
|
@ -812,7 +812,7 @@ class BenchmarkDataStorage(Benchmark):
|
||||||
|
|
||||||
class BenchmarkWithRate(Benchmark):
|
class BenchmarkWithRate(Benchmark):
|
||||||
id = Column(UUID(as_uuid=True), ForeignKey(Benchmark.id), primary_key=True)
|
id = Column(UUID(as_uuid=True), ForeignKey(Benchmark.id), primary_key=True)
|
||||||
rate = Column(SmallInteger, nullable=False)
|
rate = Column(Float, nullable=False)
|
||||||
|
|
||||||
def __str__(self) -> str:
|
def __str__(self) -> str:
|
||||||
return '{} points'.format(self.rate)
|
return '{} points'.format(self.rate)
|
||||||
|
|
|
@ -299,7 +299,7 @@ class BenchmarkDataStorage(Benchmark):
|
||||||
|
|
||||||
|
|
||||||
class BenchmarkWithRate(Benchmark):
|
class BenchmarkWithRate(Benchmark):
|
||||||
rate = Integer(required=True)
|
rate = Float(required=True)
|
||||||
|
|
||||||
|
|
||||||
class BenchmarkProcessor(BenchmarkWithRate):
|
class BenchmarkProcessor(BenchmarkWithRate):
|
||||||
|
|
|
@ -0,0 +1,128 @@
|
||||||
|
{
|
||||||
|
"type": "Snapshot",
|
||||||
|
"uuid": "00000000-0000-0000-0000-000000000000",
|
||||||
|
"software": "Workbench",
|
||||||
|
"version": "11.0a1",
|
||||||
|
"expectedEvents": [],
|
||||||
|
"closed": true,
|
||||||
|
"endTime": "0001-01-01 00:00:00",
|
||||||
|
"device": {
|
||||||
|
"manufacturer": "Dell Inc.",
|
||||||
|
"model": "Latitude E6440",
|
||||||
|
"serialNumber": "FJBQVZ1",
|
||||||
|
"events": [],
|
||||||
|
"type": "Laptop",
|
||||||
|
"chassis": "Laptop"
|
||||||
|
},
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"manufacturer": "Intel Corp.",
|
||||||
|
"model": "Intel Core i7-4600M CPU @ 2.90GHz",
|
||||||
|
"serialNumber": null,
|
||||||
|
"events": [],
|
||||||
|
"type": "Processor",
|
||||||
|
"speed": 1.259899,
|
||||||
|
"address": 64,
|
||||||
|
"cores": 2,
|
||||||
|
"threads": 4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"manufacturer": "Samsung",
|
||||||
|
"model": "M471B5173DB0-YK0",
|
||||||
|
"serialNumber": "732CD498",
|
||||||
|
"events": [],
|
||||||
|
"type": "RamModule",
|
||||||
|
"format": "SODIMM",
|
||||||
|
"size": 4096,
|
||||||
|
"interface": "DDR3",
|
||||||
|
"speed": 1600.0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"manufacturer": "Samsung",
|
||||||
|
"model": "M471B5173DB0-YK0",
|
||||||
|
"serialNumber": "152DD498",
|
||||||
|
"events": [],
|
||||||
|
"type": "RamModule",
|
||||||
|
"format": "SODIMM",
|
||||||
|
"size": 4096,
|
||||||
|
"interface": "DDR3",
|
||||||
|
"speed": 1600.0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"manufacturer": null,
|
||||||
|
"model": "Crucial_CT525MX3",
|
||||||
|
"serialNumber": "164014297BCC",
|
||||||
|
"events": [],
|
||||||
|
"type": "HardDrive",
|
||||||
|
"size": 500786,
|
||||||
|
"interface": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"manufacturer": "Intel Corporation",
|
||||||
|
"model": "4th Gen Core Processor Integrated Graphics Controller",
|
||||||
|
"serialNumber": null,
|
||||||
|
"events": [],
|
||||||
|
"type": "GraphicCard",
|
||||||
|
"memory": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"manufacturer": "Intel Corporation",
|
||||||
|
"model": "Ethernet Connection I217-LM",
|
||||||
|
"serialNumber": "ec:f4:bb:0b:18:90",
|
||||||
|
"events": [],
|
||||||
|
"type": "NetworkAdapter",
|
||||||
|
"speed": 1000,
|
||||||
|
"wireless": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"manufacturer": "Intel Corporation",
|
||||||
|
"model": "Centrino Advanced-N 6235",
|
||||||
|
"serialNumber": "c4:d9:87:47:90:e1",
|
||||||
|
"events": [],
|
||||||
|
"type": "NetworkAdapter",
|
||||||
|
"wireless": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"manufacturer": null,
|
||||||
|
"model": null,
|
||||||
|
"serialNumber": "da:b4:3a:25:88:6c",
|
||||||
|
"events": [],
|
||||||
|
"type": "NetworkAdapter",
|
||||||
|
"wireless": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"manufacturer": "Intel Corporation",
|
||||||
|
"model": "Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller",
|
||||||
|
"serialNumber": null,
|
||||||
|
"events": [],
|
||||||
|
"type": "SoundCard"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"manufacturer": "CNFCH52J48303+YF2",
|
||||||
|
"model": "Laptop_Integrated_Webcam_HD",
|
||||||
|
"serialNumber": null,
|
||||||
|
"events": [],
|
||||||
|
"type": "SoundCard"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"manufacturer": "Intel Corporation",
|
||||||
|
"model": "8 Series/C220 Series Chipset High Definition Audio Controller",
|
||||||
|
"serialNumber": null,
|
||||||
|
"events": [],
|
||||||
|
"type": "SoundCard"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"manufacturer": "Dell Inc.",
|
||||||
|
"model": "0159N7",
|
||||||
|
"serialNumber": "/FJBQVZ1/CN1296342I009B/",
|
||||||
|
"events": [],
|
||||||
|
"type": "Motherboard",
|
||||||
|
"usb": 3,
|
||||||
|
"firewire": 0,
|
||||||
|
"serial": 1,
|
||||||
|
"pcmcia": 0,
|
||||||
|
"slots": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"elapsed": 0
|
||||||
|
}
|
|
@ -320,3 +320,8 @@ def test_workbench_asus_1001pxd_rate_low(user: UserClient):
|
||||||
"""Tests an Asus 1001pxd with a low rate."""
|
"""Tests an Asus 1001pxd with a low rate."""
|
||||||
s = file('asus-1001pxd.snapshot')
|
s = file('asus-1001pxd.snapshot')
|
||||||
snapshot, _ = user.post(res=em.Snapshot, data=s)
|
snapshot, _ = user.post(res=em.Snapshot, data=s)
|
||||||
|
|
||||||
|
|
||||||
|
def test_david(user: UserClient):
|
||||||
|
s = file('david.lshw.snapshot')
|
||||||
|
snapshot, _ = user.post(res=em.Snapshot, data=s)
|
||||||
|
|
Reference in New Issue