Skip to content

Commit

Permalink
fix some errors
Browse files Browse the repository at this point in the history
  • Loading branch information
thielpa committed Jan 19, 2025
1 parent ead9a15 commit b36762c
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 46 deletions.
48 changes: 25 additions & 23 deletions compose.test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,29 +48,31 @@ services:
networks:
- helios-network

application-server:
image: eclipse-temurin:21
working_dir: /usr/src/app
command: sh -c "./gradlew e2eTest"
ports:
- '8080:8080'
volumes:
- ./server/application-server:/usr/src/app/
environment:
- SPRING_PROFILES_ACTIVE=test
- NATS_SERVER=""
- NATS_AUTH_TOKEN=""
- ORGANIZATION_NAME=ls1intum/Helios
- GITHUB_AUTH_TOKEN=${GITHUB_TOKEN}
- REPOSITORY_NAME=Helios
- RUN_ON_STARTUP_COOLDOWN=0
- OAUTH_ISSUER_URL=http://keycloak:8081/auth/realms/helios
depends_on:
- postgres
- client
- keycloak
networks:
- helios-network
# application-server:
# image: eclipse-temurin:21
# working_dir: /usr/src/app
# command: sh -c "./gradlew e2eTest"
# ports:
# - '8080:8080'
# volumes:
# - ./server/application-server:/usr/src/app/
# - ./test:/usr/src/app/build/reports
# environment:
# - PWDEBUG=1
# - SPRING_PROFILES_ACTIVE=test
# - NATS_SERVER=""
# - NATS_AUTH_TOKEN=""
# - ORGANIZATION_NAME=ls1intum/Helios
# - GITHUB_AUTH_TOKEN=${GITHUB_TOKEN}
# - REPOSITORY_NAME=Helios
# - RUN_ON_STARTUP_COOLDOWN=0
# - OAUTH_ISSUER_URL=http://keycloak:8081/auth/realms/helios
# depends_on:
# - postgres
# - client
# - keycloak
# networks:
# - helios-network

keycloak:
image: quay.io/keycloak/keycloak:latest
Expand Down
5 changes: 4 additions & 1 deletion server/application-server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,11 @@ openApi {
}

tasks.named("test") {
}

tasks.register("unitTest", Test) {
group = "application"
description = "Run unit/integration tests of the Spring Boot application with the test profile"
description = "Run unit tests of the Spring Boot application with the test profile"
useJUnitPlatform {
excludeTags "playwright"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@
@Log4j2
public class GitHubDataSyncService {
private final GitHubLabelSyncService gitHubLabelSyncService;
@Value("${monitoring.timeframe}")

@Value("${monitoring.timeframe:0}")
private int timeframe;

@Value("${monitoring.runOnStartupCooldownInMinutes}")
@Value("${monitoring.runOnStartupCooldownInMinutes:0}")
private int runOnStartupCooldownInMinutes;

private final DataSyncStatusRepository dataSyncStatusRepository;
Expand All @@ -49,7 +50,8 @@ public GitHubDataSyncService(
GitHubBranchSyncService branchSyncService,
GitHubEnvironmentSyncService environmentSyncService,
GitHubDeploymentSyncService deploymentSyncService,
GitHubCommitSyncService commitSyncService, GitHubLabelSyncService gitHubLabelSyncService) {
GitHubCommitSyncService commitSyncService,
GitHubLabelSyncService gitHubLabelSyncService) {
this.dataSyncStatusRepository = dataSyncStatusRepository;
this.userSyncService = userSyncService;
this.repositorySyncService = repositorySyncService;
Expand Down Expand Up @@ -107,7 +109,6 @@ public void syncData() {
pullRequestSyncService.syncPullRequestsOfAllRepositories(repositories, Optional.of(cutoffDate));
log.info("[Step 3/10] Completed Pull Request Sync");


// Sync environments
log.info("--------------------------------------------------");
log.info("[Step 4/10] Syncing Environments...");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
@Log4j2
public class GitHubRepositorySyncService {

@Value("${monitoring.repositories}")
@Value("${monitoring.repositories:[]}")
private String[] repositoriesToMonitor;

private final GitHub github;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
@Log4j2
public class NatsConfig {

@Value("${nats.enabled}")
@Value("${nats.enabled:false}")
private boolean isNatsEnabled;

@Value("${nats.server}")
@Value("${nats.server:}")
private String natsServer;

@Value("${nats.auth.token}")
@Value("${nats.auth.token:}")
private String natsAuthToken;

private final Environment environment;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,22 @@
public class NatsConsumerService {
private static final int INITIAL_RECONNECT_DELAY_SECONDS = 2;

@Value("${nats.enabled}")
@Value("${nats.enabled:false}")
private boolean isNatsEnabled;

@Value("${nats.timeframe}")
@Value("${nats.timeframe:0}")
private int timeframe;

@Value("${nats.server}")
@Value("${nats.server:}")
private String natsServer;

@Value("${nats.durableConsumerName}")
@Value("${nats.durableConsumerName:}")
private String durableConsumerName;

@Value("${monitoring.repositories}")
@Value("${monitoring.repositories:[]}")
private String[] repositoriesToMonitor;

@Value("${nats.auth.token}")
@Value("${nats.auth.token:}")
private String natsAuthToken;

private final Environment environment;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ public class NatsNotificationPublisherService {

private Connection natsConnection;

@Value("${nats.enabled}")
@Value("${nats.enabled:false}")
private boolean isNatsEnabled;

@Value("${nats.server}")
@Value("${nats.server:}")
private String natsServer;

@Value("${nats.auth.token}")
@Value("${nats.auth.token:}")
private String natsAuthToken;

@EventListener(ApplicationReadyEvent.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,18 @@ spring:
oauth2:
resourceserver:
jwt:
issuer-uri: "url.invalid"
issuer-uri: "url.invalid"

nats:
enabled: false


github:
organizationName: "mock"
# Can be any OAuth token, such as the PAT
authToken: ${GITHUB_TOKEN:}
cache:
enabled: true
ttl: 500
# in MB
size: 50
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package org.example;

import static org.junit.jupiter.api.Assertions.assertEquals;
package de.tum.cit.aet.helios;

import com.microsoft.playwright.Browser;
import com.microsoft.playwright.Page;
import com.microsoft.playwright.Playwright;
import io.zonky.test.db.AutoConfigureEmbeddedDatabase;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest()
@Tag("playwright")
@AutoConfigureEmbeddedDatabase
public class TrivialPlaywrightTestE2E {

// This will be injected with the random free port
Expand All @@ -21,7 +21,6 @@ public class TrivialPlaywrightTestE2E {

@Test
public void testClicking() {
assertEquals(true, false);
Browser browser = playwright.chromium().launch();
Page page = browser.newPage();
page.navigate("http://localhost:" + port + "/");
Expand Down

0 comments on commit b36762c

Please sign in to comment.