Skip to content

Commit

Permalink
[DEBUG] Try run all tests
Browse files Browse the repository at this point in the history
  • Loading branch information
LecrisUT committed Jun 1, 2024
1 parent 517d6f1 commit c2af8f7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 13 deletions.
1 change: 1 addition & 0 deletions .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ packages:
create-archive:
- spectool -g -s0 rust-atuin.spec
- sh -c 'rust2rpm --vendor atuin ${PACKIT_PROJECT_VERSION}'
- sh -c 'sed -i "/%global cargo_install_lib/d" rust-atuin.spec'
- sh -c 'echo atuin-${PACKIT_PROJECT_VERSION}.crate'
get-current-version:
- rpmspec -q --qf "%{Version}" --srpm rust-atuin.spec
Expand Down
17 changes: 12 additions & 5 deletions rust-atuin.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
%bcond_without check

# prevent library files from being installed
%global cargo_install_lib 0

%global crate atuin

Expand All @@ -17,6 +16,9 @@ Source: %{crates_source}
Source: atuin-18.2.0-vendor.tar.xz

BuildRequires: cargo-rpm-macros >= 26
%if %{with check}
BuildRequires: postgresql-test-rpm-macros
%endif

%global _description %{expand:
Atuin replaces your existing shell history with a SQLite database, and records additional context for your commands. Additionally, it provides optional and fully encrypted synchronisation of your history between machines, via an Atuin server.}
Expand All @@ -25,7 +27,8 @@ Atuin replaces your existing shell history with a SQLite database, and records a

%package -n %{crate}
Summary: %{summary}
License: MIT
# FIXME: paste output of %%cargo_license_summary here
License: # FIXME
# LICENSE.dependencies contains a full license breakdown

%description -n %{crate} %{_description}
Expand Down Expand Up @@ -69,9 +72,13 @@ EOF

%if %{with check}
%check
# * These tests are skipped because they required a Postgres database to be
# running, which is not possible in the build environment.
%cargo_test -- -- --skip sync --skip change_password --skip multi_user_test --skip registration
# start a postgres instance for the tests to use
export PGTESTS_LOCALE="C.UTF-8"
export PGTESTS_USERS="atuin:pass"
export PGTESTS_DATABASES="atuin:atuin"
export PGTESTS_PORT=5432
%postgresql_tests_run
%cargo_test
%endif

%changelog
Expand Down
21 changes: 13 additions & 8 deletions rust2rpm.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,23 @@ extra-files = [
]

summary = "magical shell history"
cargo-install-lib = true

description = "Atuin replaces your existing shell history with a SQLite database, and records additional context for your commands. Additionally, it provides optional and fully encrypted synchronisation of your history between machines, via an Atuin server."

[tests]
skip = [
"sync",
"change_password",
"multi_user_test",
"registration"
[requires]
test = [
"postgresql-test-rpm-macros",
]
comments = [
"These tests are skipped because they required a Postgres database to be running, which is not possible in the build environment."

[scripts.check]
pre = [
"# start a postgres instance for the tests to use",
"export PGTESTS_LOCALE=\"C.UTF-8\"",
"export PGTESTS_USERS=\"atuin:pass\"",
"export PGTESTS_DATABASES=\"atuin:atuin\"",
"export PGTESTS_PORT=5432",
"%postgresql_tests_run",
]


Expand Down

0 comments on commit c2af8f7

Please sign in to comment.