Skip to content

Commit 3d20be3

Browse files
committed
Merge pull request #27 from codebendercc/cron-jobs
Cron jobs
2 parents fcd5a0c + a07ca38 commit 3d20be3

File tree

5 files changed

+31
-9
lines changed

5 files changed

+31
-9
lines changed

bin/cron/cb_compile_tester

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
python ../seleniumbender.py sketches --target=live --saucelabs --capabilities=capabilities_firefox.yaml --config=../config.cfg

bin/cron/common

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
# common
4+
python ../seleniumbender.py common --target=live --saucelabs --capabilities=capabilities_firefox.yaml --config=../config.cfg
5+
python ../seleniumbender.py common --target=live --saucelabs --capabilities=capabilities_chrome.yaml --config=../config.cfg
6+
# walkthrough
7+
python ../seleniumbender.py walkthrough --target=live --saucelabs --capabilities=capabilities_firefox.yaml --config=../config.cfg
8+
python ../seleniumbender.py walkthrough --target=live --saucelabs --capabilities=capabilities_chrome.yaml --config=../config.cfg
9+
# noplugin
10+
python ../seleniumbender.py noplugin --target=live --saucelabs --capabilities=capabilities_firefox.yaml --config=../config.cfg
11+
python ../seleniumbender.py noplugin --target=live --saucelabs --capabilities=capabilities_chrome.yaml --config=../config.cfg

bin/cron/compile_examples

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
python ../seleniumbender.py examples --target=live --saucelabs --capabilities=capabilities_firefox.yaml --config=../config.cfg

bin/cron/libraries_fetch

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
python ../seleniumbender.py libraries --target=live --saucelabs --capabilities=capabilities_firefox.yaml --config=../config.cfg

codebender_testing/utils.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -532,21 +532,24 @@ def open_all_libraries_and_examples(self, url, logfile):
532532
compile_type = 'fetch'
533533
urls_to_visit, log_entry, log_file, log_time = self.resume_log(logfile, compile_type, examples_libraries)
534534

535-
library_re = re.compile(r'^https://codebender.cc/library/.+$')
536-
example_re = re.compile(r'^https://codebender.cc/example/.+/.+$')
535+
libraries_re = re.compile(r'/libraries$')
536+
library_re = re.compile(r'/library/.+$')
537+
example_re = re.compile(r'/example/.+/.+$')
537538

538539
print '\nVisiting:', len(urls_to_visit), 'URLs'
539540
tic = time.time()
540541
for url in urls_to_visit:
541542
self.open(url)
542-
url_name = url.split('/')[-1]
543-
name = self.get_element(By.CSS_SELECTOR, '#mycontainer h1 small').text
544-
name = re.sub('[()]', '', name).split('.')[0]
545-
if (name != url_name):
546-
print "Didn't open url: ", url
543+
self.get_element(By.CSS_SELECTOR, '#mycontainer h1')
544+
if library_re.match(url):
545+
url_name = url.split('/')[-1]
546+
name = self.get_element(By.CSS_SELECTOR, '#mycontainer h1 small').text
547+
name = re.sub('[()]', '', name).split('.')[0]
548+
if (name != url_name):
549+
print "Didn't open url: ", url
547550

548551
test_status = True
549-
if library_re.match(url) and self.driver.current_url == 'https://codebender.cc/libraries':
552+
if library_re.match(url) and libraries_re.match(self.driver.current_url):
550553
test_status = False
551554
elif example_re.match(url) and 'Sorry! The example could not be fetched.' in self.driver.page_source:
552555
test_status = False
@@ -630,7 +633,6 @@ def comment_compile_libraries_examples(self, sketches, library_examples_dic={},
630633

631634
# Initialize DisqusWrapper.
632635
disqus_wrapper = DisqusWrapper(log_time)
633-
print "urls to visit:", urls_to_visit
634636

635637
print '\nCommenting and compiling:', len(urls_to_visit), 'libraries and examples.'
636638

0 commit comments

Comments
 (0)