Skip to content

Commit

Permalink
Introduce env variable to run LS perf test in GH actions
Browse files Browse the repository at this point in the history
  • Loading branch information
KavinduZoysa committed Nov 22, 2023
1 parent 3957cf1 commit 3316803
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/daily_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
env:
packageUser: ${{ github.actor }}
packagePAT: ${{ secrets.GITHUB_TOKEN }}
LS_PERFORMANCE_TESTS_IN_GITHUB_WORKFLOW: true
run: |
export DISPLAY=':99.0'
/usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/nightly_publish_timestamped_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
env:
publishUser: ${{ secrets.BALLERINA_BOT_USERNAME }}
publishPAT: ${{ secrets.BALLERINA_BOT_TOKEN }}
LS_PERFORMANCE_TESTS_IN_GITHUB_WORKFLOW: true
run: |
./gradlew clean build -x createJavadoc --scan --continue --rerun-tasks
./gradlew publish
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pull_request_full_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
echo "::set-output name=version::$VERSION"
- name: Build ballerina-lang
env:
LS_PERFORMANCE_TESTS_IN_GITHUB_WORKFLOW: true
run: |
./gradlew clean build -x check publishToMavenLocal --stacktrace --scan
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pull_request_ubuntu_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ jobs:
env:
packageUser: ${{ github.actor }}
packagePAT: ${{ secrets.GITHUB_TOKEN }}
LS_PERFORMANCE_TESTS_IN_GITHUB_WORKFLOW: true
run: |
export DISPLAY=':99.0'
/usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pull_request_windows_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,6 @@ jobs:
env:
packageUser: ${{ github.actor }}
packagePAT: ${{ secrets.GITHUB_TOKEN }}
LS_PERFORMANCE_TESTS_IN_GITHUB_WORKFLOW: true
run: ./gradlew.bat build --continue -x :ballerina-lang:test -x :jballerina-integration-test:test -x :ballerina-shell:shell-cli:test -x :ballerina-cli:test -x createJavadoc --stacktrace -scan --console=plain --no-daemon --no-parallel

4 changes: 4 additions & 0 deletions .github/workflows/push_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ jobs:
restore-keys: ${{ runner.os }}-gradle

- name: Build with Gradle
env:
LS_PERFORMANCE_TESTS_IN_GITHUB_WORKFLOW: true
run: |
export DISPLAY=':99.0'
/usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
Expand Down Expand Up @@ -78,6 +80,8 @@ jobs:
restore-keys: ${{ runner.os }}-gradle

- name: Build with Gradle
env:
LS_PERFORMANCE_TESTS_IN_GITHUB_WORKFLOW: true
run: ./gradlew.bat build --continue -x :ballerina-lang:test -x :jballerina-integration-test:test -x :ballerina-shell:shell-cli:test -x :jballerina-debugger-integration-test:test -x createJavadoc --stacktrace -scan --console=plain --no-daemon --no-parallel


Expand Down
6 changes: 5 additions & 1 deletion language-server/modules/langserver-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,11 @@ test {
systemProperty "ballerina.home", "$buildDir/"
systemProperty "experimental", "true"
systemProperty "ballerina.version", project.version
systemProperty "responseTimeThreshold", 2000
if (System.getenv('LS_PERFORMANCE_TESTS_IN_GITHUB_WORKFLOW')) {
systemProperty "responseTimeThreshold", 4000
} else {
systemProperty "responseTimeThreshold", 400
}
useTestNG() {
suites 'src/test/resources/testng.xml'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public String getResourceDir() {
}

@Override
@Test(dataProvider = "codeaction-data-provider", enabled = false)
@Test(dataProvider = "codeaction-data-provider")
public void test(String config) throws IOException, WorkspaceDocumentException {
super.test(config);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
*/
public class CompletionPerformanceTest extends CompletionTest {

@Test(dataProvider = "completion-data-provider", enabled = false)
@Test(dataProvider = "completion-data-provider")
@Override
public void test(String config, String configPath) throws WorkspaceDocumentException, IOException {
super.test(config, configPath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class HoverPerformanceTest extends HoverProviderTest {

private final List<Long> executionTimes = new ArrayList<>();

@Test(description = "Test Hover provider", dataProvider = "hover-data-provider", enabled = false)
@Test(description = "Test Hover provider", dataProvider = "hover-data-provider")
public void testHover(String config) throws IOException {
// We run the same test multiple times and take the average of them as the execution time. This is to
// reduce the effect of first compilation and outliers
Expand Down

0 comments on commit 3316803

Please sign in to comment.