mirror of
https://github.com/ZwareBear/awx.git
synced 2026-05-17 07:48:39 -05:00
Adds network UI test framework
This adds a test framework to drive UI tests from the client instead of injecting events from the websocket. Tests consist of a pair of snapshots (before and after the test) and a list of UI events to process. Tests are run using a FSM in the client that controls the resetting of state to the snapshot, injecting the events into the UI, recording test coverage, and reporting tests to the server. * Adds design for event trace table * Adds design for a coverage tracking table * Adds models for EventTrace and Coverage * Adds trace_id to recording messages * Adds design for TopologySnapshot table * Adds order to TopologySnapshot table * Adds TopologySnapshot table * Adds Snapshot message when recordings are started and stoppped * Adds models for tracking test cases and test results * Adds designs for a test runner FSM * Updates test management commands with new schema * Adds download recording button * Adds models to track tests * Adds ui test runner * Adds id and client to TestResult design * Adds id and client to TestResult * Update message types * Stores test results and code coverage from the test runner * Adds tool to generate a test coverage report * Adds APIs for tests and code coverage * Adds per-test-case coverage reports * Breaks out coverage for loading the modules from the tests * Re-raises server-side errors * Captures errors during tests * Adds defaults for host name and host type * Disables test FSM trace storage * Adds support for sending server error message to the client * Resets the UI flags, history, and toolbox contents between tests * Adds istanbul instrumentation to network-ui
This commit is contained in:
@@ -175,3 +175,63 @@ class TopologyInventory(models.Model):
|
||||
topology_inventory_id = models.AutoField(primary_key=True,)
|
||||
topology = models.ForeignKey('Topology',)
|
||||
inventory_id = models.IntegerField()
|
||||
|
||||
|
||||
class EventTrace(models.Model):
|
||||
|
||||
event_trace_id = models.AutoField(primary_key=True,)
|
||||
client = models.ForeignKey('Client',)
|
||||
trace_session_id = models.IntegerField(default=0)
|
||||
event_data = models.TextField()
|
||||
message_id = models.IntegerField()
|
||||
|
||||
|
||||
class Coverage(models.Model):
|
||||
|
||||
coverage_id = models.AutoField(primary_key=True,)
|
||||
coverage_data = models.TextField()
|
||||
test_result = models.ForeignKey('TestResult',)
|
||||
|
||||
|
||||
class TopologySnapshot(models.Model):
|
||||
|
||||
topology_snapshot_id = models.AutoField(primary_key=True,)
|
||||
client = models.ForeignKey('Client',)
|
||||
topology_id = models.IntegerField()
|
||||
trace_session_id = models.IntegerField()
|
||||
snapshot_data = models.TextField('TopologySnapshot',)
|
||||
order = models.IntegerField()
|
||||
|
||||
|
||||
class TestCase(models.Model):
|
||||
|
||||
test_case_id = models.AutoField(primary_key=True,)
|
||||
name = models.CharField('TestCase', max_length=200,)
|
||||
test_case_data = models.TextField()
|
||||
|
||||
|
||||
class Result(models.Model):
|
||||
|
||||
result_id = models.AutoField(primary_key=True,)
|
||||
name = models.CharField(max_length=20,)
|
||||
|
||||
|
||||
class CodeUnderTest(models.Model):
|
||||
|
||||
code_under_test_id = models.AutoField('CodeUnderTest', primary_key=True,)
|
||||
version_x = models.IntegerField()
|
||||
version_y = models.IntegerField()
|
||||
version_z = models.IntegerField()
|
||||
commits_since = models.IntegerField()
|
||||
commit_hash = models.CharField(max_length=40,)
|
||||
|
||||
|
||||
class TestResult(models.Model):
|
||||
|
||||
test_result_id = models.AutoField(primary_key=True,)
|
||||
test_case = models.ForeignKey('TestCase',)
|
||||
result = models.ForeignKey('Result',)
|
||||
code_under_test = models.ForeignKey('CodeUnderTest',)
|
||||
time = models.DateTimeField()
|
||||
id = models.IntegerField(default=0)
|
||||
client = models.ForeignKey('Client',)
|
||||
|
||||
Reference in New Issue
Block a user