<commit_before>#!/bin/bash
# Copyright (C) 2021 <NAME> <<EMAIL>>
# SPDX-License-Identifier: LGPL-2.0-or-later

set -euo pipefail

USE_SYSTEMDIR=yes

. $(dirname $0)/libtest.sh

skip_without_bwrap
skip_revokefs_without_fuse

echo "1..1"

sleep 1
HISTORY_START_TIME=$(date +"%Y-%m-%d %H:%M:%S")

mkdir -p ${TEST_DATA_DIR}/system-history-installation
mkdir -p ${FLATPAK_CONFIG_DIR}/installations.d
cat << EOF > ${FLATPAK_CONFIG_DIR}/installations.d/history-installation.conf
[Installation "history-installation"]
Path=${TEST_DATA_DIR}/system-history-installation
EOF

# setup repo and install from it
setup_repo_no_add
port=$(cat httpd-port)
${FLATPAK} --installation=history-installation remote-add \
    --gpg-import=${FL_GPG_HOMEDIR}/pubring.gpg test-repo "http://127.0.0.1:${port}/test"
${FLATPAK} --installation=history-installation install -y test-repo org.test.Hello master<commit_msg>test-history.sh: Fix flakiness by moving sleep<commit_after>#!/bin/bash
# Copyright (C) 2021 <NAME> <<EMAIL>>
# SPDX-License-Identifier: LGPL-2.0-or-later

set -euo pipefail

USE_SYSTEMDIR=yes

. $(dirname $0)/libtest.sh

skip_without_bwrap
skip_revokefs_without_fuse

echo "1..1"

HISTORY_START_TIME=$(date +"%Y-%m-%d %H:%M:%S")
sleep 1

mkdir -p ${TEST_DATA_DIR}/system-history-installation
mkdir -p ${FLATPAK_CONFIG_DIR}/installations.d
cat << EOF > ${FLATPAK_CONFIG_DIR}/installations.d/history-installation.conf
[Installation "history-installation"]
Path=${TEST_DATA_DIR}/system-history-installation
EOF

# setup repo and install from it
setup_repo_no_add
port=$(cat httpd-port)
${FLATPAK} --installation=history-installation remote-add \
    --gpg-import=${FL_GPG_HOMEDIR}/pubring.gpg test-repo "http://127.0.0.1:${port}/test"
${FLATPAK} --installation=history-installation install -y test-repo org.test.Hello master
{'fraction_non_alphanumeric': 0.15516289342904474, 'fraction_numerical': 0.0176697956929873, 'mean_word_length': 5.613138686131387, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2060029', 'n_tokens_mistral': 699, 'n_tokens_neox': 680, 'n_words': 120}