Skip to content

Commit

Permalink
Separate tests requiring internet connectivity (#2097)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmhewitt authored Oct 29, 2023
1 parent 01be1af commit 1da5402
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,31 @@ jobs:
env:
DESTDIR: out
run: |
meson build
meson setup -Dintegration_tests=true build
ninja -C build install
ninja -C build test
- name: Build and Test (Fedora)
env:
DESTDIR: out
run: |
meson configure -Dcurated=false -Dpayments=false build
meson configure -Dintegration_tests=true -Dcurated=false -Dpayments=false build
ninja -C build install
ninja -C build test
- name: Build and Test (Pop!_Shop)
env:
DESTDIR: out
run: |
meson configure -Dcurated=false -Dpayments=false -Dsharing=false -Dname=Pop\!_Shop build
meson configure -Dintegration_tests=true -Dcurated=false -Dpayments=false -Dsharing=false -Dname=Pop\!_Shop build
ninja -C build install
ninja -C build test
- name: Build (Flatpak-only)
env:
DESTDIR: out
run: |
meson configure -Dpackagekit_backend=false -Dubuntu_drivers_backend=false build
meson configure -Dintegration_tests=true -Dpackagekit_backend=false -Dubuntu_drivers_backend=false build
ninja -C build install
lint:
Expand Down
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ option('hide_upstream_distro_apps', type : 'boolean', value : true, description
option('runtime_name', type : 'string', value : 'io.elementary.Platform', description : 'The name of the distributor runtime')
option('packagekit_backend', type : 'boolean', value : true, description : 'Use PackageKit as a backend')
option('ubuntu_drivers_backend', type : 'boolean', value : true, description : 'Use Ubuntu Drivers as a backend (requires packagekit_backend)')
option('integration_tests', type : 'boolean', value : false, description : 'Enable integration tests, require internet connection')
1 change: 0 additions & 1 deletion test/CoreTest.vala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ void main (string[] args) {
Test.init (ref args);
add_card_tests ();
add_houston_tests ();
add_soup_client_tests ();
add_stripe_tests ();
Test.run ();
}
5 changes: 5 additions & 0 deletions test/Integration.vala
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
void main (string[] args) {
Test.init (ref args);
add_soup_client_tests ();
Test.run ();
}
File renamed without changes.
16 changes: 13 additions & 3 deletions test/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,26 @@ core_tests = executable(
meson.project_name() + '-core-tests',
'Core/CardUtils.vala',
'Core/Houston.vala',
'Core/SoupClient.vala',
'Core/Stripe.vala',
'CoreTest.vala',
'MockHttpClient.vala',
meson.project_source_root() + '/src/Core/CardUtils.vala',
meson.project_source_root() + '/src/Core/Houston.vala',
meson.project_source_root() + '/src/Core/HttpClient.vala',
meson.project_source_root() + '/src/Core/SoupClient.vala',
meson.project_source_root() + '/src/Core/Stripe.vala',
dependencies: core_deps
)

test('AppCenter core tests', core_tests)
integration_tests = executable(
meson.project_name() + '-integration-tests',
'Integration/SoupClient.vala',
'Integration.vala',
meson.project_source_root() + '/src/Core/HttpClient.vala',
meson.project_source_root() + '/src/Core/SoupClient.vala',
dependencies: core_deps
)

test('AppCenter core tests', core_tests)
if get_option('integration_tests')
test('AppCenter integration tests', integration_tests)
endif

0 comments on commit 1da5402

Please sign in to comment.