Skip to content

Commit

Permalink
Revert "Merge branch 'master' into 12048-migrate-feedback-results-page"
Browse files Browse the repository at this point in the history
This reverts commit b3c1300, reversing
changes made to bd326a0.
  • Loading branch information
mingyuanc committed Apr 14, 2024
1 parent b3c1300 commit e9416e1
Show file tree
Hide file tree
Showing 38 changed files with 114 additions and 3,465 deletions.
25 changes: 2 additions & 23 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ dependencies {
implementation("org.jsoup:jsoup:1.15.2")
implementation("org.hibernate.orm:hibernate-core:6.1.6.Final")
implementation("org.postgresql:postgresql:42.7.2")
implementation("org.hibernate:hibernate-hikaricp:6.1.6.Final")
implementation("org.hibernate.orm:hibernate-agroal:6.1.6.Final")
implementation("io.agroal:agroal-pool:2.1")

testAnnotationProcessor(testng)

Expand All @@ -101,9 +102,7 @@ dependencies {
exclude group: "org.apache.jmeter", module: "bom"
}

liquibaseRuntime("org.liquibase:liquibase-core:4.19.0")
liquibaseRuntime("info.picocli:picocli:4.7.1")
liquibaseRuntime("org.postgresql:postgresql:42.7.2")
liquibaseRuntime(sourceSets.main.output)
}

Expand Down Expand Up @@ -138,10 +137,6 @@ sourceSets {
}
}

if (!project.hasProperty("runList")) {
project.ext.set("runList", "main")
}

liquibase {
activities {
main {
Expand All @@ -151,23 +146,7 @@ liquibase {
username project.properties['liquibaseUsername']
password project.properties['liquibasePassword']
}
snapshot {
url project.properties['liquibaseDbUrl']
username project.properties['liquibaseUsername']
password project.properties['liquibasePassword']
snapshotFormat "json"
outputFile "liquibase-snapshot.json"
}
diffMain {
searchPath "${projectDir}"
changeLogFile "src/main/resources/db/changelog/db.changelog-new.xml"
referenceUrl project.properties['liquibaseDbUrl']
referenceUsername project.properties['liquibaseUsername']
referencePassword project.properties['liquibasePassword']
url "offline:postgresql?snapshot=liquibase-snapshot.json"
}
}
runList = project.ext.runList
}

tasks.withType(cz.habarta.typescript.generator.gradle.GenerateTask) {
Expand Down
1 change: 0 additions & 1 deletion docs/_markbind/layouts/default.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
* [Captcha]({{ baseUrl }}/captcha.html)
* [Documentation]({{ baseUrl }}/documentation.html)
* [Emails]({{ baseUrl }}/emails.html)
* [Unit Testing]({{ baseUrl }}/unit-testing.html)
* [End-to-End Testing]({{ baseUrl }}/e2e-testing.html)
* [Performance Testing]({{ baseUrl }}/performance-testing.html)
* [Accessibility Testing]({{ baseUrl }}/axe-testing.html)
Expand Down
6 changes: 1 addition & 5 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,7 @@ There are two big categories of testing in TEAMMATES:
- **Component tests**: white-box unit and integration tests, i.e. they test the application components with full knowledge of the components' internal workings. This is configured in `src/test/resources/testng-component.xml` (back-end) and `src/web/jest.config.js` (front-end).
- **E2E (end-to-end) tests**: black-box tests, i.e. they test the application as a whole without knowing any internal working. This is configured in `src/e2e/resources/testng-e2e.xml`. To learn more about E2E tests, refer to this [document](e2e-testing.md).

<div id="running-tests">

#### Running tests
#### Running the tests

##### Frontend tests

Expand Down Expand Up @@ -337,8 +335,6 @@ You can generate the coverage data with `jacocoReport` task after running tests,

The report can be found in the `build/reports/jacoco/jacocoReport/` directory.

</div>

## Deploying to a staging server

> `Staging server` is the server instance you set up on Google App Engine for hosting the app for testing purposes.
Expand Down
34 changes: 0 additions & 34 deletions docs/schema-migration.md

This file was deleted.

206 changes: 0 additions & 206 deletions docs/unit-testing.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ protected void doOperationRemotely() {
System.out.println("Going to connect to:" + appDomain + ":" + appPort);

DatastoreOptions.Builder builder = DatastoreOptions.newBuilder().setProjectId(Config.APP_ID);
// if (ClientProperties.isTargetUrlDevServer()) {
// builder.setHost(ClientProperties.TARGET_URL);
// }
if (ClientProperties.isTargetUrlDevServer()) {
builder.setHost(ClientProperties.TARGET_URL);
}
ObjectifyService.init(new ObjectifyFactory(builder.build().getService()));
OfyHelper.registerEntityClasses();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@
import com.google.cloud.datastore.QueryResults;
import com.googlecode.objectify.cmd.Query;

import jakarta.persistence.TypedQuery;
import jakarta.persistence.criteria.CriteriaBuilder;
import jakarta.persistence.criteria.CriteriaQuery;
import jakarta.persistence.criteria.Root;

// import jakarta.persistence.criteria.CriteriaDelete;

import teammates.client.connector.DatastoreClient;
Expand Down Expand Up @@ -131,27 +126,6 @@ private void doMigration(teammates.storage.entity.Account entity) {
* Migrates the entity.
*/
protected void migrateEntity(teammates.storage.entity.Account oldAccount) {
HibernateUtil.beginTransaction();

CriteriaBuilder cb = HibernateUtil.getCriteriaBuilder();
CriteriaQuery<teammates.storage.sqlentity.Account> cr = cb.createQuery(
teammates.storage.sqlentity.Account.class);
Root<teammates.storage.sqlentity.Account> root = cr.from(teammates.storage.sqlentity.Account.class);
cr.select(root).where(cb.equal(root.get("googleId"), oldAccount.getGoogleId()));

TypedQuery<teammates.storage.sqlentity.Account> query = HibernateUtil.createQuery(cr);


boolean isEntityInDb = query.getResultList().size() != 0;
HibernateUtil.commitTransaction();

// In db, but somehow not set as migrated.
if (isEntityInDb) {
oldAccount.setMigrated(true);
entitiesOldAccountSavingBuffer.add(oldAccount);
return;
};

teammates.storage.sqlentity.Account newAccount = new teammates.storage.sqlentity.Account(
oldAccount.getGoogleId(),
oldAccount.getName(),
Expand All @@ -162,6 +136,7 @@ protected void migrateEntity(teammates.storage.entity.Account oldAccount) {
oldAccount.setMigrated(true);
entitiesOldAccountSavingBuffer.add(oldAccount);
migrateReadNotification(oldAccount, newAccount);

}

private void migrateReadNotification(teammates.storage.entity.Account oldAccount,
Expand Down
Loading

0 comments on commit e9416e1

Please sign in to comment.