<commit_before>package io.spacedog.watchdog;

import org.joda.time.DateTime;
import org.junit.runner.JUnitCore;
import org.junit.runner.notification.Failure;
import org.junit.runner.notification.RunListener;

import com.amazonaws.services.lambda.runtime.Context;

import io.spacedog.jobs.Job;
import io.spacedog.rest.SpaceEnv;

public class Watchdog extends RunListener {

	private Job job = new Job();

	public void addToDescription(String string) {
		job.addToDescription(string);
	}

	public String run(Context context) {
		job.addToDescription(context.getFunctionName());
		return run();
	}

	public String run() {

		try {
			job.addToDescription(SpaceEnv.defaultEnv().target().host());

			JUnitCore junit = new JUnitCore();
			junit.addListener(this);

			junit.run(BackendResourceTestOften.class);
			junit.run(CredentialsResourceTestOften.class);
			junit.run(CrossOriginFilterTestOften.class);
			junit.run(DataAccessControlTestOften.class);
			junit.run(DataResourceTestOften.class);
			junit.run(DataResource2TestOften.class);
			junit.run(LogResourceTestOften.class);
			junit.run(PushResourceTestOften.class);
			junit.run(SchemaResourceTestOften.class);
			junit.run(SearchResourceTestOften.class);
			junit.run(ServiceErrorFilterTestOften.class);

			int hourOfDay = DateTime.now().hourOfDay().get();
			if (4 <= hourOfDay && hourOfDay < 5) {

				junit.run(BackendResourceTestOncePerDay.class);
				junit.run(ServiceErrorFilterTestOncePerDay.class);
				junit.run(FileResourceTestOncePerDay.class);
				junit.run(ShareResourceTestOncePerDay.class);
				junit.run(WebResourceTestOncePerDay.class);

				job.ok();
			}

			return Job.OK;

		} catch (Throwable t) {
			return job.error(t);
		}
	}

	@Override
	public void testFailure(Failure failure) {
		job.error(new StringBuilder()//
				.append(failure.getMessage()).append('\n')//
				.append(failure.getTrace()).toString());
	}

	public static void main(String[] args) {
		Watchdog watchdog = new Watchdog();
		watchdog.addToDescription("watchdog");
		watchdog.run();
	}
}
<commit_msg>Runs only one test every hour, the rest only once per day<commit_after>package io.spacedog.watchdog;

import org.joda.time.DateTime;
import org.junit.runner.JUnitCore;
import org.junit.runner.notification.Failure;
import org.junit.runner.notification.RunListener;

import com.amazonaws.services.lambda.runtime.Context;

import io.spacedog.jobs.Job;
import io.spacedog.rest.SpaceEnv;

public class Watchdog extends RunListener {

	private Job job = new Job();

	public void addToDescription(String string) {
		job.addToDescription(string);
	}

	public String run(Context context) {
		job.addToDescription(context.getFunctionName());
		return run();
	}

	public String run() {

		try {
			job.addToDescription(SpaceEnv.defaultEnv().target().host());

			JUnitCore junit = new JUnitCore();
			junit.addListener(this);

			junit.run(DataResourceTestOften.class);

			int hourOfDay = DateTime.now().getHourOfDay();
			if (4 <= hourOfDay && hourOfDay < 5) {

				junit.run(BackendResourceTestOften.class);
				junit.run(CredentialsResourceTestOften.class);
				junit.run(CrossOriginFilterTestOften.class);
				junit.run(DataAccessControlTestOften.class);
				junit.run(DataResource2TestOften.class);
				junit.run(LogResourceTestOften.class);
				junit.run(PushResourceTestOften.class);
				junit.run(SchemaResourceTestOften.class);
				junit.run(SearchResourceTestOften.class);
				junit.run(ServiceErrorFilterTestOften.class);
				junit.run(BackendResourceTestOncePerDay.class);
				junit.run(ServiceErrorFilterTestOncePerDay.class);
				junit.run(FileResourceTestOncePerDay.class);
				junit.run(ShareResourceTestOncePerDay.class);
				junit.run(WebResourceTestOncePerDay.class);

				job.ok();
			}

			return Job.OK;

		} catch (Throwable t) {
			return job.error(t);
		}
	}

	@Override
	public void testFailure(Failure failure) {
		job.error(new StringBuilder()//
				.append(failure.getMessage()).append('\n')//
				.append(failure.getTrace()).toString());
	}

	public static void main(String[] args) {
		Watchdog watchdog = new Watchdog();
		watchdog.addToDescription("watchdog");
		watchdog.run();
	}
}

{'fraction_non_alphanumeric': 0.12593126652247055, 'fraction_numerical': 0.0014419610670511895, 'mean_word_length': 4.756569847856155, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3747424', 'n_tokens_mistral': 1492, 'n_tokens_neox': 1317, 'n_words': 211}