Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto reload result page on state change from scheduled to running #940

Merged
merged 1 commit into from
Oct 17, 2016

Conversation

asdil12
Copy link
Member

@asdil12 asdil12 commented Oct 12, 2016

@asdil12 asdil12 changed the title Auto reload result page on state sched -> running Auto reload result page on state change from scheduled to running Oct 12, 2016
@coveralls
Copy link

Coverage Status

Coverage remained the same at 71.938% when pulling 264eb99 on asdil12:sched_auto_refresh into 16630fb on os-autoinst:master.

else if (state == "scheduled") {
// reload when test starts
window.setInterval(function() {
$.ajax("/tests/" + jobid + "/status").done(function(newStatus) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't hard code URLs in javascript - I thought I told you yesterday

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed.

@okurz
Copy link
Member

okurz commented Oct 12, 2016

Good approach

window.setInterval(function() {
$.ajax(status_url).done(function(newStatus) {
if (newStatus.state == 'running' || newStatus.state == 'waiting') {
setTimeout(function() {location.href = location.href.replace(/#.*/, '');}, 1000);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we shouldn't just reload if the status changed. If the job goes from scheduled to obsoleted, you want to know too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 72.064% when pulling a428e17 on asdil12:sched_auto_refresh into af3c010 on os-autoinst:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 72.064% when pulling e62aed9 on asdil12:sched_auto_refresh into 1881b13 on os-autoinst:master.

@coolo
Copy link
Contributor

coolo commented Oct 12, 2016

Now of course I wonder if this can't be tested.

@coolo
Copy link
Contributor

coolo commented Oct 12, 2016

it's not obvious how, but as this is not a critical feature put some thought into it

@asdil12
Copy link
Member Author

asdil12 commented Oct 17, 2016

Rebased.

@asdil12
Copy link
Member Author

asdil12 commented Oct 17, 2016

The complete js code on the running page is not tested because phantomJS doesn't like our websocket stuff. Also I don't see a way of updating the db that is used by the phantomJS mojo instance while the mojo instance is running.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 72.089% when pulling 28e17b5 on asdil12:sched_auto_refresh into 5df32f2 on os-autoinst:master.

@coolo coolo merged commit 3cb08f0 into os-autoinst:master Oct 17, 2016
@asdil12 asdil12 deleted the sched_auto_refresh branch October 17, 2016 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants