Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update test-module.yml to use DigitalOcean infrastructure for testing #43

Merged
merged 1 commit into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/test-module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ jobs:
uses: NethServer/ns8-github-actions/.github/workflows/module-info.yml@main
run_tests:
needs: module
uses: NethServer/ns8-github-actions/.github/workflows/test-on-ubuntu-runner.yml@main
uses: NethServer/ns8-github-actions/.github/workflows/test-on-digitalocean-infra.yml@main
with:
args: "ghcr.io/${{needs.module.outputs.owner}}/${{needs.module.outputs.name}}:${{needs.module.outputs.tag}}"
repo_ref: ${{needs.module.outputs.sha}}
debug_shell: ${{ github.event.inputs.debug_shell == 'true' || false }}
secrets:
do_token: ${{ secrets.do_token }}
14 changes: 14 additions & 0 deletions tests/api.resource
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
*** Settings ***
Library SSHLibrary

*** Keywords ***
Run task
[Arguments] ${action} ${input} ${decode_json}=${TRUE} ${rc_expected}=0
${stdout} ${stderr} ${rc} = Execute Command api-cli run ${action} --data '${input}' return_stdout=True return_stderr=True return_rc=True
Should Be Equal As Integers ${rc_expected} ${rc} Run task ${action} failed!${\n}${stderr}
IF ${decode_json} and len($stdout) > 0
${response} = Evaluate json.loads('''${stdout}''') modules=json
ELSE
${response} = Set Variable ${stdout}
END
[Return] ${response}
5 changes: 3 additions & 2 deletions tests/ejabberd.robot
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*** Settings ***
Library SSHLibrary
Resource api.resource

*** Test Cases ***
Check if ejabberd is installed correctly
Expand All @@ -10,12 +11,12 @@ Check if ejabberd is installed correctly
Set Suite Variable ${module_id} ${output.module_id}

Check if ejabberd can be configured
${rc} = Execute Command api-cli run module/${module_id}/configure-module --data '{}'
${rc} = Execute Command api-cli run module/${module_id}/configure-module --data '{"hostname":"ejabberd.org","ldap_domain":"nethserver.org","adminsList":"[email protected],[email protected]","http_upload":true,"s2s":true,"shaper_normal":500000,"shaper_fast":1000000,"mod_http_upload_unlimited":true,"mod_mam_status":true,"purge_mnesia_unlimited":false,"purge_mnesia_interval":30,"lets_encrypt":true,"purge_httpd_upload_interval":31,"webadmin":false}'
... return_rc=True return_stdout=False
Should Be Equal As Integers ${rc} 0

Check if ejabberd works as expected
${rc} = Execute Command curl -f http://127.0.0.1/ejabberd/
${rc} = Execute Command curl -k https://localhost:5280/api/status
... return_rc=True return_stdout=False
Should Be Equal As Integers ${rc} 0

Expand Down
Loading