Skip to content
This repository has been archived by the owner on Jan 27, 2023. It is now read-only.

Commit

Permalink
fix: added test case (#7)
Browse files Browse the repository at this point in the history
* fix: added test case
* refactor: changed where version is defined in test case
* refactor: rewrote all the test-cases
* refactor: changed ref for testing-remote-action case
  • Loading branch information
anthonygauthier authored May 19, 2022
1 parent 065287e commit ada2d88
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 18 deletions.
41 changes: 25 additions & 16 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@ env:
BRANCH_NAME: main

jobs:
test-local-folder:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

# Doing this here to simulate already having the test suite within the repo
- name: Checkout repo locally
uses: actions/checkout@v3
with:
repository: liatrio/gatling-maven-showcase
ref: ${{ env.BRANCH_NAME }}
path: ./test

- name: Run Gatling Test Suite from local folder
uses: ./
# test-local-folder:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3

# # Doing this here to simulate already having the test suite within the repo
# - name: Checkout repo locally
# uses: actions/checkout@v3
# with:
# repository: liatrio/gatling-maven-showcase
# ref: ${{ env.BRANCH_NAME }}
# path: ./test

# - name: Run Gatling Test Suite from local folder
# uses: ./

test-with-repo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Run Gatling Test Suite from repository
uses: ./
with:
Expand All @@ -47,3 +47,12 @@ jobs:
repoName: liatrio/gatling-maven-showcase
repoRef: ${{ env.BRANCH_NAME }}
simulationClass: "simulations.GoogleStressSimulation"

testing-remote-action:
runs-on: ubuntu-latest
steps:
- uses: liatrio/run-gatling@main
with:
repoName: liatrio/gatling-maven-showcase
repoRef: ${{ env.BRANCH_NAME }}
simulationClass: "simulations.GoogleStressSimulation"
10 changes: 8 additions & 2 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ inputs:
required: true
testPath:
description: "Path to the Gatling Test Suite"
default: "./test"
default: "test"
required: true
repoName:
description: "Name of the repository to checkout ('org/repo')"
Expand All @@ -26,6 +26,9 @@ inputs:
runs:
using: "composite"
steps:
- name: Checkout action code
uses: actions/checkout@v3

- name: Checkout Test Suite if not local
if: ${{ !hashFiles(inputs.testPath) }}
uses: actions/checkout@v3
Expand All @@ -40,7 +43,10 @@ runs:
distribution: ${{ inputs.javaDistribution }}
java-version: ${{ inputs.javaVersion }}

- run: mvn -f ${{ inputs.testPath }} gatling:test ${{ inputs.simulationClass != '' && '-Dgatling.simulationClass=' || '' }}${{ inputs.simulationClass }}
- run: |
ls -l $GITHUB_WORKSPACE/
ls -l $GITHUB_WORKSPACE/test
mvn -f $GITHUB_WORKSPACE/${{ inputs.testPath }} gatling:test ${{ inputs.simulationClass != '' && '-Dgatling.simulationClass=' || '' }}${{ inputs.simulationClass }}
shell: bash
- name: Generate Job Summary
Expand Down

0 comments on commit ada2d88

Please sign in to comment.