mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 02:15:43 +03:00
Add assertion for the volume k/v pairs in task rows
This commit is contained in:
@@ -91,6 +91,17 @@ module('Acceptance | allocation detail', function(hooks) {
|
||||
const events = server.db.taskEvents.where({ taskStateId: task.id });
|
||||
const event = events[events.length - 1];
|
||||
|
||||
const taskGroup = server.schema.taskGroups.where({
|
||||
jobId: allocation.jobId,
|
||||
name: allocation.taskGroup,
|
||||
}).models[0];
|
||||
|
||||
const jobTask = taskGroup.tasks.models.find(m => m.name === task.name);
|
||||
const volumes = jobTask.volumeMounts.map(volume => ({
|
||||
name: volume.Volume,
|
||||
source: taskGroup.volumes[volume.Volume].Source,
|
||||
}));
|
||||
|
||||
Allocation.tasks[0].as(taskRow => {
|
||||
assert.equal(taskRow.name, task.name, 'Name');
|
||||
assert.equal(taskRow.state, task.state, 'State');
|
||||
@@ -113,6 +124,12 @@ module('Acceptance | allocation detail', function(hooks) {
|
||||
assert.ok(addressesText.includes(port.Label), `Found label ${port.Label}`);
|
||||
assert.ok(addressesText.includes(port.Value), `Found value ${port.Value}`);
|
||||
});
|
||||
|
||||
const volumesText = taskRow.volumes;
|
||||
volumes.forEach(volume => {
|
||||
assert.ok(volumesText.includes(volume.name), `Found label ${volume.name}`);
|
||||
assert.ok(volumesText.includes(volume.source), `Found value ${volume.source}`);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ export default create({
|
||||
message: text('[data-test-message]'),
|
||||
time: text('[data-test-time]'),
|
||||
ports: text('[data-test-ports]'),
|
||||
volumes: text('[data-test-volumes]'),
|
||||
|
||||
hasUnhealthyDriver: isPresent('[data-test-icon="unhealthy-driver"]'),
|
||||
hasProxyTag: isPresent('[data-test-proxy-tag]'),
|
||||
|
||||
Reference in New Issue
Block a user