Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dhadka committed Jul 31, 2024
0 parents commit 1ffdfce
Show file tree
Hide file tree
Showing 12 changed files with 392 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
44 changes: 44 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Tests

on:
push:
workflow_dispatch:
inputs:
java-distribution:
type: choice
required: true
description: Java distribution
options:
- 'zulu'
- 'temurin'
- 'oracle'
default: 'zulu'
java-version
type: choice
required: true
description: Java version
options:
- '17'
- '18'
- '19'
- '20'
- '21'
default: '17'

env:
JAVA_VERSION: ${{ inputs.java-version || '17' }}
JAVA_DISTRIBUTION: ${{ inputs.java-distribution || 'zulu' }}

jobs:
maven-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
cache: maven
- run: mvn test

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.settings/
/target/
/pisa_binaries/
23 changes: 23 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>IntegrationTests</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Integration and Performance Testing
56 changes: 56 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.moeaframework</groupId>
<artifactId>integration-tests</artifactId>
<version>0.0.1-SNAPSHOT</version>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>

<repositories>
<repository>
<id>oss.sonatype.org</id>
<name>OSS Sonatype Staging</name>
<url>https://oss.sonatype.org/content/groups/staging</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>org.moeaframework</groupId>
<artifactId>moeaframework</artifactId>
<version>4.3</version>
</dependency>
<dependency>
<groupId>org.moeaframework</groupId>
<artifactId>gd</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>org.moeaframework</groupId>
<artifactId>jmetal-plugin</artifactId>
<version>6.2.3</version>
</dependency>
<dependency>
<groupId>org.moeaframework</groupId>
<artifactId>pisa-plugin</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>org.moeaframework</groupId>
<artifactId>real-world-benchmarks</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
</dependencies>

</project>
92 changes: 92 additions & 0 deletions src/CreatingReleases.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Release Guide for the MOEA Framework

## One Time Setup

The following generates a new signing key. These keys are valid for several years, but if expired or lost we can always generate new keys.

1. Generate a new GPG key:
```
gpg --gen-key
# Name: MOEAFramework
# Email: [email protected]
# Password: Leave blank / unprotected
```
2. Publish key to key server:
```
gpg --keyserver keyserver.ubuntu.com --send-keys <keyId>
```
3. Create base64 encoded version of the key
```
gpg --armor --export-secret-key <keyId> | base64
```
4. Update the `GPG_SIGNING_KEY` [secret on GitHub Actions](https://github.com/MOEAFramework/MOEAFramework/settings/secrets/actions) with the new value

## Updating Dependencies

To update dependencies, first update the version numbers in `META-INF/build.properties`. If adding or removing dependencies, also make the necessary
changes to `build.xml`, `test.xml`, and `pom.xml`.

Run the `update-libraries` Ant target to update the JAR files. Push these changes into the repo.

## Publishing New Version

1. Create a PR to publish the new version
1. Update version number in `META-INF/build.properties` and `README.md`
2. Update version number, releate date, and changelog in `docs/news.md`
3. Update `website/xslt/archive.xml` with links to older versions
4. Update copyright notices as required.
2. Merge PR once all CI tests pass
3. Trigger the [staging release](https://github.com/MOEAFramework/MOEAFramework/actions/workflows/staging.yml) to prepare all deployment files
4. Publish the Maven package
1. Download the Maven bundle from the staging release and upload as an "artifact bundle" to `oss.sonatype.org`
2. Edit `pom.xml` in this repo with the new version number and verify the CI tests pass
3. Release the new version
5. Publish GitHub release - https://github.com/MOEAFramework/MOEAFramework/releases
6. Merge the Website update - https://github.com/MOEAFramework/Website/pulls

## Building and Publishing Book

1. GitHub Actions handles compiling the Latex. For local development use [TexLive](https://www.tug.org/texlive/windows.html).
2. Makes changes to https://github.com/MOEAFramework/MOEABook
3. GitHub Actions produces an artifact with the new book PDF, preview PDF, and supplemental materials Zip
3. If the supplemental materials Zip ever changes (very infrequently)
1. Upload new version to Google Drive, share via link, and get the download URL
2. Create a new bit.ly shortened URL
3. Update book with the new link
4. If the PDF ever changes
1. Log into lulu.com
2. Edit the Beginner's Guide to the MOEAFramework product and replace the PDF
3. Publish!

## Old Release Notes

1. Update `META-INF/build.properties` with new version number.
2. Update `news.md` with version number, release date, and release notes.
3. Update `website/xslt/archive.xml` with links to the last version.
4. If necessary, update the copyright year.
1. Source code is updated using the `update-header` Ant task in `auxiliary/checkstyle/build.xml`.
2. Search for the previous year and update any other locations
5. Ensure all test runs pass.
1. `ant -f text.xml`
2. `ant -f test.xml build-maven-tests & cd build & mvn test`
6. Run all of the `package-*` Ant tasks in `build.xml`.
7. Create a new Github Release using a tag in the format `vX.XX`.
1. Copy the release notes from `news.md`
2. Publish the following files in the `dist` folder:
- `MOEAFramework-X.XX.tar.gz`
- `MOEAFramework-X.XX-Demo.jar`
- `MOEAFramework-X.XX-Source.tar.gz`
8. Publish the Maven package:
1. Run the `package-maven` Ant task in `build.xml`.
2. Visit `oss.sonatype.org` and login
3. Create a new Staging Upload, select Artifact Bundle, and upload `*-bundle.jar` from `maven/`
4. Verify the package by editing `pom.xml` (in this repo) and setting the new version number
5. If CI is passing, release the new version
6. Update README.md with the new Maven link and example
9. Publish the new website:
1. Run the `package-website` Ant task in `build.xml`.
2. Checkout the latest `MOEAFramework\Website` repo and switch to the `gh-pages` branch.
3. Copy the entire contents of the `build` folder into the `Website` repo.
4. Commit and push.
5. Verify the download links work on the website.
10. Publish new version of book
45 changes: 45 additions & 0 deletions src/test/java/org/moeaframework/integration/BasicTests.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package org.moeaframework.integration;

import java.io.IOException;

import org.junit.Assert;
import org.junit.Test;
import org.moeaframework.Executor;
import org.moeaframework.algorithm.NSGAII;
import org.moeaframework.core.NondominatedPopulation;
import org.moeaframework.core.Problem;
import org.moeaframework.problem.DTLZ.DTLZ2;

public class BasicTests {

@Test
public void testDirect() {
Problem problem = new DTLZ2(2);

NSGAII algorithm = new NSGAII(problem);
algorithm.run(10000);

NondominatedPopulation result = algorithm.getResult();

Assert.assertNotNull(result);
Assert.assertTrue(result.size() > 0);
}

@Test
public void testSPI() {
NondominatedPopulation result = new Executor()
.withProblem("UF1")
.withAlgorithm("NSGAII")
.withMaxEvaluations(10000)
.run();

Assert.assertNotNull(result);
Assert.assertTrue(result.size() > 0);
}

@Test
public void testReferenceSet() throws IOException {
Assert.assertNotNull(NondominatedPopulation.loadReferenceSet("pf/DTLZ2.2D.pf"));
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package org.moeaframework.integration;

import org.junit.Assert;
import org.junit.Test;
import org.moeaframework.Executor;
import org.moeaframework.core.NondominatedPopulation;

public class GeneralizedDecompositionTests {

@Test
public void test() {
NondominatedPopulation result = new Executor()
.withProblem("UF1")
.withAlgorithm("GD-MOEA/D")
.withMaxEvaluations(10000)
.run();

Assert.assertNotNull(result);
Assert.assertTrue(result.size() > 0);
}

}
22 changes: 22 additions & 0 deletions src/test/java/org/moeaframework/integration/JMetalTests.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package org.moeaframework.integration;

import org.junit.Assert;
import org.junit.Test;
import org.moeaframework.Executor;
import org.moeaframework.core.NondominatedPopulation;

public class JMetalTests {

@Test
public void test() {
NondominatedPopulation result = new Executor()
.withProblem("UF1")
.withAlgorithm("AbYSS-JMetal")
.withMaxEvaluations(10000)
.run();

Assert.assertNotNull(result);
Assert.assertTrue(result.size() > 0);
}

}
22 changes: 22 additions & 0 deletions src/test/java/org/moeaframework/integration/PISATests.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package org.moeaframework.integration;

import org.junit.Assert;
import org.junit.Test;
import org.moeaframework.Executor;
import org.moeaframework.core.NondominatedPopulation;

public class PISATests {

@Test
public void testPISA() {
NondominatedPopulation result = new Executor()
.withProblem("UF1")
.withAlgorithm("hype-pisa")
.withMaxEvaluations(10000)
.run();

Assert.assertNotNull(result);
Assert.assertTrue(result.size() > 0);
}

}
Loading

0 comments on commit 1ffdfce

Please sign in to comment.