Put pkg/persistence and cmd/data in tmpfs

This commit is contained in:
Alessio 2024-09-15 15:18:54 -07:00
parent b9c63cb35a
commit 67f2852ac7
2 changed files with 10 additions and 7 deletions

View File

@ -13,7 +13,7 @@ fi
FAKE_VERSION="1.100.3489" FAKE_VERSION="1.100.3489"
./compile.sh $FAKE_VERSION ./compile.sh $FAKE_VERSION
test -e data && rm -r data test -e data/profile && rm -r data/profile
PATH=`pwd`:$PATH PATH=`pwd`:$PATH
@ -22,8 +22,8 @@ test "$(tw --version)" = "v$FAKE_VERSION"
tw --help tw --help
test $? -eq 0 test $? -eq 0
tw create_profile data tw create_profile data/profile
cd data cd data/profile
# Should only contain default profile image # Should only contain default profile image
test $(find profile_images | wc -l) = "2" test $(find profile_images | wc -l) = "2"
@ -203,10 +203,10 @@ test $(find profile_images/RememberAfghan1* | grep banner | wc -l) = "0"
# Test that the `--profile` flag works # Test that the `--profile` flag works
cd .. cd ../..
tw --profile data fetch_user elonmusk tw --profile data/profile fetch_user elonmusk
test $(sqlite3 data/twitter.db "select count(*) from users where handle = 'elonmusk'") = "1" test $(sqlite3 data/profile/twitter.db "select count(*) from users where handle = 'elonmusk'") = "1"
cd data cd -
# Test that fetching tweets with ID only (not full URL) works # Test that fetching tweets with ID only (not full URL) works
test $(sqlite3 twitter.db "select count(*) from tweets where id = 1433713164546293767") = "0" # Check it's not already there test $(sqlite3 twitter.db "select count(*) from tweets where id = 1433713164546293767") = "0" # Check it's not already there

View File

@ -0,0 +1,3 @@
#!/bin/bash
mount -t tmpfs -o size=100M tmpfs pkg/persistence/test_profiles