Skip to content
Open
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
51 changes: 44 additions & 7 deletions .github/scripts/print_behat_tags_json.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,62 @@
# Search tags.
declare -A tags

# If the first argument is -d or --debug, enable debug output.
debug=$([[ "$1" == "-d" || "$1" == "--debug" ]] && echo "1" || echo "")

parallelrunmissing=false
for feature in `find ./src/ -iname *.feature`
do
if [[ "$1" == "snapshots" ]] && ! grep -q -i "the UI should match the snapshot" "$feature"; then
continue
fi
tag=`head -n 1 $feature | sed -E s/\\\\s+.*//`
tags[$tag]=$tag

featuretags=`head -n 1 $feature`
# Count non-blank lines in feature file also ignoring comments on the start of the line.
lines=`grep -c -v -e '^[[:space:]]*$' -e '^[[:space:]]*#' $feature`
parallelruninfile=false
for tag in $featuretags; do
# Only include @app_parallel_run_ tags.
if [[ "$tag" =~ @app_parallel_run_ ]]; then
parallelruninfile=true
if [[ -n "${tags[$tag]}" ]]; then
tags[$tag]=$((${tags[$tag]} + lines))
else
tags[$tag]="$lines"
fi
break
fi
done

if [ "$parallelruninfile" = false ] ; then
# Invalid or missing tag in $feature
parallelrunmissing=true
fi
done

# Serialize to JSON.
tags_json="["

for tag in "${tags[@]}"
tags_json=""
for tag in $(printf "%s\n" "${!tags[@]}" | sort);
do
if [ ! -z "$debug" ]; then
lines=${tags[$tag]}
echo "$tag - $lines lines"
fi

tags_json+="\"$tag\","
done

tags_json="${tags_json%?}"
tags_json+="]"

# In there's any invalid tags, use the negation of all other tags.
negation=""
if [ "$parallelrunmissing" = true ] ; then
for tag in $(printf "%s\n" "${!tags[@]}" | sort);
do
negation+="~${tag}&&"
done
tags_json="${tags_json},\"${negation%??}\""
fi

# Print to console.
echo $tags_json
echo "[${tags_json}]"
9 changes: 7 additions & 2 deletions .github/workflows/acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ jobs:
run: |
if [ -z $BEHAT_TAGS ]; then
tags_json=`.github/scripts/print_behat_tags_json.sh`
echo "Generated tags: $tags_json"
echo "tags=$tags_json" >> $GITHUB_OUTPUT;
else
echo "tags=[\"$BEHAT_TAGS\"]" >> $GITHUB_OUTPUT;
Expand Down Expand Up @@ -186,18 +187,22 @@ jobs:
BEHAT_TAGS: ${{ matrix.tags }}
MOODLE_BEHAT_SELENIUM_IMAGE: selenium/standalone-chrome:latest

- name: Rename snapshot failure files
run: |
echo "PARALLEL_NAME=${matrix.tags#@app_parallel_run_//}" >> $GITHUB_ENV
echo ${{ env.PARALLEL_NAME }}
- name: Upload Snapshot failures
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: snapshot_failures-${{ matrix.tags }}
name: snapshot_failures-${{ env.PARALLEL_NAME }}
path: moodle/public/local/moodleappbehat/tests/behat/snapshots/failures/*

- name: Upload Behat failures
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: behat_failures-${{ matrix.tags }}
name: behat_failures-${{ env.PARALLEL_NAME }}
path: moodledata/behat_dump/*

complete:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_block_activity_modules @app @block @block_activity_modules @javascript @lms_upto5.0
@app_parallel_run_blocks @addon_block_activity_modules @app @block @block_activity_modules @javascript @lms_upto5.0
Feature: Basic tests of activity modules block

Background:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_block_activity_results @app @block @block_activity_results @javascript
@app_parallel_run_blocks @addon_block_activity_results @app @block @block_activity_results @javascript
Feature: Basic tests of activity results block

Background:
Expand Down
2 changes: 1 addition & 1 deletion src/addons/block/badges/tests/behat/block_badges.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_block_badges @app @block @block_badges @javascript
@app_parallel_run_badges @addon_block_badges @app @block @block_badges @javascript
Feature: Basic tests of badges block

Background:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_block_blog_menu @app @block @block_blog_menu @javascript
@app_parallel_run_blog @addon_block_blog_menu @app @block @block_blog_menu @javascript
Feature: Basic tests of blog menu block

Background:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_block_blog_recent @app @block @block_blog_recent @javascript
@app_parallel_run_blog @addon_block_blog_recent @app @block @block_blog_recent @javascript
Feature: Basic tests of blog recent block

Background:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_block_blog_tags @app @block @block_blog_tags @javascript
@app_parallel_run_blog @addon_block_blog_tags @app @block @block_blog_tags @javascript
Feature: Basic tests of blog tags block

Background:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_block_calendar_month @app @block @block_calendar_month @javascript
@app_parallel_run_calendar @addon_block_calendar_month @app @block @block_calendar_month @javascript
Feature: View the calendar block and check it links to the calendar page

Background:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_block_calendar_upcoming @app @block @block_calendar_upcoming @javascript
@app_parallel_run_calendar @addon_block_calendar_upcoming @app @block @block_calendar_upcoming @javascript
Feature: View the calendar upcoming block and check
it links to the calendar upcoming events page

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_block_comments @app @block @block_comments @javascript
@app_parallel_run_comments @addon_block_comments @app @block @block_comments @javascript
Feature: View the comments block and check
it links to the correct comments page

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_block_completionstatus @app @block @block_completionstatus @core_completion @javascript
@app_parallel_run_completion @addon_block_completionstatus @app @block @block_completionstatus @core_completion @javascript
Feature: View the completion status block and check
it links to the correct page

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_block_course_list @app @block @block_course_list @javascript
@app_parallel_run_courses @addon_block_course_list @app @block @block_course_list @javascript
Feature: View the my courses block and check it links to the my page

Background:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_block_globalsearch @app @block @block_globalsearch @javascript @lms_from4.3
@app_parallel_run_search @addon_block_globalsearch @app @block @block_globalsearch @javascript @lms_from4.3
Feature: View the global search block and check it links to the page

Background:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_block_glossary_random @app @block @block_glossary_random @javascript
@app_parallel_run_glossary @addon_block_glossary_random @app @block @block_glossary_random @javascript
Feature: Basic tests of glossay random block

Background:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_block_html @app @block @block_html @javascript
@app_parallel_run_blocks @addon_block_html @app @block @block_html @javascript
Feature: Basic tests of html block

Background:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_block_lp @app @block @block_lp @tool_lp @javascript
@app_parallel_run_competencies @addon_block_lp @app @block @block_lp @tool_lp @javascript
Feature: View the learning plans block and check
it links to the correct page

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_block_myoverview @app @block @block_myoverview @javascript
@app_parallel_run_courses @addon_block_myoverview @app @block @block_myoverview @javascript
Feature: Basic tests of my overview block

Background:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_block_news_items @app @block @block_news_items @javascript
@app_parallel_run_blocks @addon_block_news_items @app @block @block_news_items @javascript
Feature: Basic tests of news items block

Background:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_block_online_users @app @block @block_online_users @javascript
@app_parallel_run_blocks @addon_block_online_users @app @block @block_online_users @javascript
Feature: Basic tests of online users block

Background:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_block_private_files @app @block @block_private_files @javascript
@app_parallel_run_files @addon_block_private_files @app @block @block_private_files @javascript
Feature: View the private files block and check
it links to the correct page

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_block_recent_activity @app @block @block_recent_activity @javascript
@app_parallel_run_blocks @addon_block_recent_activity @app @block @block_recent_activity @javascript
Feature: Basic tests of recent activity block

Background:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_block_recentlyaccessedcourses @app @block @block_recentlyaccessedcourses @javascript
@app_parallel_run_courses @addon_block_recentlyaccessedcourses @app @block @block_recentlyaccessedcourses @javascript
Feature: Basic tests of recent accessed courses block

Background:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_block_recentlyaccesseditems @app @block @block_recentlyaccesseditems @javascript
@app_parallel_run_courses @addon_block_recentlyaccesseditems @app @block @block_recentlyaccesseditems @javascript
Feature: Basic tests of recent activity block

Background:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_block_rss_client @app @block @block_rss_client @javascript @lms_from4.5
@app_parallel_run_blocks @addon_block_rss_client @app @block @block_rss_client @javascript @lms_from4.5
Feature: Basic tests of rss client block

Background:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_block_search_forums @app @block @block_search_forums @mod_forum @javascript @lms_from4.3
@app_parallel_run_blocks @addon_block_search_forums @app @block @block_search_forums @mod_forum @javascript @lms_from4.3
Feature: View the search forums block and check
it links to the correct page

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_block_selfcompletion @app @block @block_selfcompletion @javascript
@app_parallel_run_completion @addon_block_selfcompletion @app @block @block_selfcompletion @javascript
Feature: View the self completion block and check
it links to the correct page

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_block_site_main_menu @app @block @block_site_main_menu @javascript @lms_upto4.5
@app_parallel_run_blocks @addon_block_site_main_menu @app @block @block_site_main_menu @javascript @lms_upto4.5
Feature: Basic tests of Additional activities block

Background:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_block_site_main_menu @app @block @block_site_main_menu @javascript @lms_from5.0
@app_parallel_run_blocks @addon_block_site_main_menu @app @block @block_site_main_menu @javascript @lms_from5.0
Feature: Basic tests of Additional activities block

Background:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_block_starredcourses @app @block @block_starredcourses @javascript
@app_parallel_run_courses @addon_block_starredcourses @app @block @block_starredcourses @javascript
Feature: Basic tests of starred courses block

Background:
Expand Down
2 changes: 1 addition & 1 deletion src/addons/block/tags/tests/behat/block_tags.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_block_tags @app @block @block_tags @javascript
@app_parallel_run_tags @addon_block_tags @app @block @block_tags @javascript
Feature: Basic tests of tags block

Background:
Expand Down
2 changes: 1 addition & 1 deletion src/addons/block/timeline/tests/behat/basic_usage.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_block_timeline @app @block @block_timeline @javascript
@app_parallel_run_courses @addon_block_timeline @app @block @block_timeline @javascript
Feature: Timeline block.

Background:
Expand Down
2 changes: 1 addition & 1 deletion src/addons/blog/tests/behat/edit-entry.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_blog @app @core @core_blog @javascript @lms_from4.4
@app_parallel_run_blog @addon_blog @app @core @core_blog @javascript @lms_from4.4
Feature: Edit blog entries
In order to add or edit blog entries as User

Expand Down
2 changes: 1 addition & 1 deletion src/addons/blog/tests/behat/entries.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_blog @app @core @core_blog @javascript @lms_from4.4
@app_parallel_run_blog @addon_blog @app @core @core_blog @javascript @lms_from4.4
Feature: Blog entries
In order to modify or delete a blog entry
As a user
Expand Down
2 changes: 1 addition & 1 deletion src/addons/calendar/tests/behat/create_events.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_calendar @app @core @core_calendar @javascript
@app_parallel_run_calendar @addon_calendar @app @core @core_calendar @javascript
Feature: Test creation of calendar events in app
In order to take advantage of all the calendar features while using the mobile app
As a student
Expand Down
2 changes: 1 addition & 1 deletion src/addons/competency/tests/behat/navigation.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_competency @app @tool @tool_lp @javascript
@app_parallel_run_competencies @addon_competency @app @tool @tool_lp @javascript
Feature: Test competency navigation

Background:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_coursecompletion @app @block @block_completionstatus @block_selfcompletion @javascript @lms_upto5.0
@app_parallel_run_completion @addon_coursecompletion @app @block @block_completionstatus @block_selfcompletion @javascript @lms_upto5.0
Feature: Course completion navigation

Background:
Expand Down
2 changes: 1 addition & 1 deletion src/addons/coursecompletion/tests/behat/navigation.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_coursecompletion @app @block @block_completionstatus @block_selfcompletion @javascript @lms_from5.1
@app_parallel_run_completion @addon_coursecompletion @app @block @block_completionstatus @block_selfcompletion @javascript @lms_from5.1
Feature: Course completion navigation

Background:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_coursecompletion @app @block @block_completionstatus @block_selfcompletion @javascript
@app_parallel_run_completion @addon_coursecompletion @app @block @block_completionstatus @block_selfcompletion @javascript
Feature: Student should be able to complete a course with self completion enabled.

Background:
Expand Down
2 changes: 1 addition & 1 deletion src/addons/messages/tests/behat/basic_usage.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_messages @app @core @core_message @javascript
@app_parallel_run_messages @addon_messages @app @core @core_message @javascript
Feature: Test basic usage of messages in app
In order to participate with messages while using the mobile app
As a student
Expand Down
2 changes: 1 addition & 1 deletion src/addons/messages/tests/behat/navigation.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_messages @app @core @core_message @javascript
@app_parallel_run_messages @addon_messages @app @core @core_message @javascript
Feature: Test messages navigation in the app

Background:
Expand Down
2 changes: 1 addition & 1 deletion src/addons/messages/tests/behat/settings.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_messages @app @core @core_message @javascript
@app_parallel_run_messages @addon_messages @app @core @core_message @javascript
Feature: Test messages settings

Background:
Expand Down
2 changes: 1 addition & 1 deletion src/addons/mod/assign/tests/behat/basic_usage.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_mod_assign @app @mod @mod_assign @javascript
@app_parallel_run_assign @addon_mod_assign @app @mod @mod_assign @javascript
Feature: Test basic usage of assignment activity in app
In order to participate in the assignment while using the mobile app
I need basic assignment functionality to work
Expand Down
2 changes: 1 addition & 1 deletion src/addons/mod/assign/tests/behat/grade_penalties.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_mod_assign @app @mod @mod_assign @javascript @lms_from5.0
@app_parallel_run_assign @addon_mod_assign @app @mod @mod_assign @javascript @lms_from5.0
Feature: Grade penalties in the assignment activity

Background:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_mod_assign @app @mod @mod_assign @javascript @lms_upto4.4
@app_parallel_run_assign @addon_mod_assign @app @mod @mod_assign @javascript @lms_upto4.4
Feature: Test marking workflow in assignment activity in app

Background:
Expand Down
2 changes: 1 addition & 1 deletion src/addons/mod/assign/tests/behat/marking_workflow.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_mod_assign @app @mod @mod_assign @javascript @lms_from4.5
@app_parallel_run_assign @addon_mod_assign @app @mod @mod_assign @javascript @lms_from4.5
Feature: Test marking workflow in assignment activity in app

Background:
Expand Down
2 changes: 1 addition & 1 deletion src/addons/mod/assign/tests/behat/navigation.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_mod_assign @app @mod @mod_assign @javascript
@app_parallel_run_assign @addon_mod_assign @app @mod @mod_assign @javascript
Feature: Test assignments navigation

Background:
Expand Down
2 changes: 1 addition & 1 deletion src/addons/mod/assign/tests/behat/overview.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_mod_assign @app @mod @mod_assign @javascript @lms_from5.1
@app_parallel_run_assign @addon_mod_assign @app @mod @mod_assign @javascript @lms_from5.1
Feature: Activities overview for assign activity

Background:
Expand Down
2 changes: 1 addition & 1 deletion src/addons/mod/assign/tests/behat/single_activity.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_mod_assign @app @mod @mod_assign @javascript @singleactivity
@app_parallel_run_assign @addon_mod_assign @app @mod @mod_assign @javascript @singleactivity
Feature: Test single activity of assign type in app
In order to view a assign while using the mobile app
As a student
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_mod_bigbluebuttonbn @app @mod @mod_bigbluebuttonbn @javascript
@app_parallel_run_bbb @addon_mod_bigbluebuttonbn @app @mod @mod_bigbluebuttonbn @javascript
Feature: Test basic usage of BBB activity in app
In order to join a BBB meeting while using the mobile app
As a student
Expand Down
2 changes: 1 addition & 1 deletion src/addons/mod/bigbluebuttonbn/tests/behat/groups.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@addon_mod_bigbluebuttonbn @app @mod @mod_bigbluebuttonbn @javascript
@app_parallel_run_bbb @addon_mod_bigbluebuttonbn @app @mod @mod_bigbluebuttonbn @javascript
Feature: Test usage of BBB activity with groups in app

Background:
Expand Down
Loading
Loading