From f68cfeb1ee87567c8e7d34bcf3742965866bc253 Mon Sep 17 00:00:00 2001 From: Pelayori <31128562+Pelayori@users.noreply.github.com> Date: Sat, 27 Apr 2024 01:01:05 +0200 Subject: [PATCH] Fix tests --- .github/workflows/unit-tests-push.yml | 2 +- .../java/com/uniovi/services/QuestionGeneratorService.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unit-tests-push.yml b/.github/workflows/unit-tests-push.yml index 17e4cfb8..ab827dbe 100644 --- a/.github/workflows/unit-tests-push.yml +++ b/.github/workflows/unit-tests-push.yml @@ -74,4 +74,4 @@ jobs: kill $(cat spring-boot-app.pid) - name: Collect Jacoco report and send to Sonar run: | - ./mvnw org.jacoco:jacoco-maven-plugin:report sonar:sonar -Dsonar.projectKey=Arquisoft_wiq_es04b -Dsonar.organization=arquisoft -Dsonar.branch.name=${{ github.ref }} -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_TOKEN }} -Dspring.profiles.active=test \ No newline at end of file + ./mvnw org.jacoco:jacoco-maven-plugin:report sonar:sonar -Dsonar.projectKey=Arquisoft_wiq_es04b -Dsonar.organization=arquisoft -Dsonar.branch.name=${{ github.head_ref || github.ref_name }} -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_TOKEN }} -Dspring.profiles.active=test \ No newline at end of file diff --git a/src/main/java/com/uniovi/services/QuestionGeneratorService.java b/src/main/java/com/uniovi/services/QuestionGeneratorService.java index e92a4ce0..9ae1ed0a 100644 --- a/src/main/java/com/uniovi/services/QuestionGeneratorService.java +++ b/src/main/java/com/uniovi/services/QuestionGeneratorService.java @@ -71,7 +71,9 @@ private void parseQuestionTypes() { } @Scheduled(fixedRate = 86400000, initialDelay = 86400000) - public void generateAllQuestions(){ + public void generateAllQuestions() { + started = true; + resetGeneration(); } @Scheduled(fixedRate = 150000)