Skip to content

Commit

Permalink
Optionally test performance in CI #882
Browse files Browse the repository at this point in the history
This run PerformanceTests in GitHub actions for pull requests labeled
"performance".

Note, that the event of labeling itself is not handled. This
implementation implies a contributor will have to push something to PR
after labeling to start tests.
  • Loading branch information
basilevs committed Nov 29, 2023
1 parent 9e25e9e commit 3f9c222
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,21 @@ jobs:
-DfailIfNoTests=false
clean install
working-directory: eclipse.platform.swt
- name: Performance tests
if: contains(github.event.pull_request.labels.*.name, 'performance')
uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3 # v1.0.1
with:
run: >-
mvn --batch-mode -V -U
-DforkCount=1
-Dcompare-version-with-baselines.skip=true
-Dmaven.compiler.failOnWarning=true
--fail-at-end
-DskipNativeTests=true
-DfailIfNoTests=true
-Dtest=PerformanceTests
integration-test
working-directory: eclipse.platform.swt/tests/org.eclipse.swt.tests
- name: Upload Test Results for ${{ matrix.config.name }} / Java-${{ matrix.java }}
if: always()
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
Expand Down
11 changes: 11 additions & 0 deletions tests/org.eclipse.swt.tests/.project
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,15 @@
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<filteredResources>
<filter>
<id>1701266893922</id>
<name></name>
<type>10</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-true-false-target</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.internal.Platform;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
Expand All @@ -39,6 +40,7 @@
import org.eclipse.test.performance.Dimension;
import org.eclipse.test.performance.Performance;
import org.eclipse.test.performance.PerformanceMeter;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Test;

Expand Down Expand Up @@ -70,6 +72,7 @@ public void setUp() {
*/
@Test
public void test_createComposites() {
Assume.assumeFalse("https://github.com/eclipse-platform/eclipse.platform.swt/issues/912 Very slow on Mac OS", Platform.PLATFORM.equalsIgnoreCase("cocoa"));
PerformanceMeter meter = createMeter("Create composites");
int samples;

Expand Down

0 comments on commit 3f9c222

Please sign in to comment.