Skip to content

Commit 835ba26

Browse files
authored
No test prefix (#11)
* Remove the `_test` prefix from the settings in ww3-dev.dist.yml. * Make the paths relative in webwork3.dist.yml since that was done in ww3-dev.dist.yml. With both of these done there is no need for the `sed` lines in the .github/workflows/unit-tests.yml file. Instead a simle cp will suffice.
1 parent cad4929 commit 835ba26

19 files changed

+52
-76
lines changed

.github/workflows/unit-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ jobs:
1717
env:
1818
HARNESS_PERL_SWITCHES: -MDevel::Cover
1919
run: |
20-
sed 's/\/opt\/webwork\//\/__w\/webwork3\//g' conf/webwork3.dist.yml > conf/webwork3.yml
21-
sed 's/\/opt\/webwork\//\/__w\/webwork3\//g' conf/ww3-dev.dist.yml > conf/ww3-dev.yml
20+
cp conf/webwork3.dist.yml conf/webwork3.yml
21+
cp conf/ww3-dev.dist.yml conf/ww3-dev.yml
2222
perl t/db/build_db.pl
2323
prove -r t
2424

conf/webwork3.dist.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
22
secrets:
33
- 3cdf63327fcf77deaed1d200df4b9fee66af2326
4-
webwork3_home: /opt/webwork/webwork3
4+
webwork3_home: .
55

66
# Database settings
77

88
# For the sqlite database
9-
database_dsn: dbi:SQLite:/opt/webwork/webwork3/t/db/sample_db.sqlite
9+
database_dsn: dbi:SQLite:./t/db/sample_db.sqlite
1010
# For mysql or mariadb
1111
#database_dsn: dbi:mysql:dbname=webwork3
1212

conf/ww3-dev.dist.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ webwork3_home: .
1111
# database that is different than others.
1212

1313
# For the sqlite database
14-
test_database_dsn: dbi:SQLite:./t/db/sample_db.sqlite
14+
database_dsn: dbi:SQLite:./t/db/sample_db.sqlite
1515
# For mysql or mariadb
1616
# note: choose a database
17-
#test_database_dsn: dbi:mysql:dbname=webwork3_test
18-
19-
17+
#database_dsn: dbi:mysql:dbname=webwork3_test
2018

19+
# Database credentials for mysql or mariadb.
20+
# These are ignored if the 'sqlite' database is used.
21+
database_user: webworkWrite
22+
database_password: password

t/db/001_courses.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ die "The file $config_file does not exist. Did you make a copy of it from ww3-d
3434
my $config = LoadFile($config_file);
3535

3636
my $schema =
37-
DB::Schema->connect($config->{test_database_dsn}, $config->{database_user}, $config->{database_password});
37+
DB::Schema->connect($config->{database_dsn}, $config->{database_user}, $config->{database_password});
3838

3939
# $schema->storage->debug(1); # print out the SQL commands.
4040

t/db/002_course_settings.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ die "The file $config_file does not exist. Did you make a copy of it from ww3-d
3838
my $config = LoadFile($config_file);
3939

4040
my $schema =
41-
DB::Schema->connect($config->{test_database_dsn}, $config->{database_user}, $config->{database_password});
41+
DB::Schema->connect($config->{database_dsn}, $config->{database_user}, $config->{database_password});
4242

4343
# $schema->storage->debug(1); # print out the SQL commands.
4444

t/db/003_users.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ if (-e $config_file) {
3535
}
3636

3737
my $schema =
38-
DB::Schema->connect($config->{test_database_dsn}, $config->{database_user}, $config->{database_password});
38+
DB::Schema->connect($config->{database_dsn}, $config->{database_user}, $config->{database_password});
3939

4040
# $schema->storage->debug(1); # print out the SQL commands.
4141

t/db/004_course_users.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ die "The file $config_file does not exist. Did you make a copy of it from ww3-d
3333
my $config = LoadFile($config_file);
3434

3535
my $schema =
36-
DB::Schema->connect($config->{test_database_dsn}, $config->{database_user}, $config->{database_password});
36+
DB::Schema->connect($config->{database_dsn}, $config->{database_user}, $config->{database_password});
3737

3838
# $schema->storage->debug(1); # print out the SQL commands.
3939

t/db/005_hwsets.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ die "The file $config_file does not exist. Did you make a copy of it from ww3-d
3636
my $config = LoadFile($config_file);
3737

3838
my $schema =
39-
DB::Schema->connect($config->{test_database_dsn}, $config->{database_user}, $config->{database_password});
39+
DB::Schema->connect($config->{database_dsn}, $config->{database_user}, $config->{database_password});
4040

4141
my $strp = DateTime::Format::Strptime->new(pattern => '%FT%T', on_error => 'croak');
4242

t/db/006_quizzes.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ die "The file $config_file does not exist. Did you make a copy of it from ww3-d
3535
my $config = LoadFile($config_file);
3636

3737
my $schema =
38-
DB::Schema->connect($config->{test_database_dsn}, $config->{database_user}, $config->{database_password});
38+
DB::Schema->connect($config->{database_dsn}, $config->{database_user}, $config->{database_password});
3939

4040
my $strp = DateTime::Format::Strptime->new(pattern => '%FT%T', on_error => 'croak');
4141

t/db/007_user_set.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ die "The file $config_file does not exist. Did you make a copy of it from ww3-d
3737
my $config = LoadFile($config_file);
3838

3939
my $schema =
40-
DB::Schema->connect($config->{test_database_dsn}, $config->{database_user}, $config->{database_password});
40+
DB::Schema->connect($config->{database_dsn}, $config->{database_user}, $config->{database_password});
4141

4242
my $strp = DateTime::Format::Strptime->new(pattern => '%FT%T', on_error => 'croak');
4343

0 commit comments

Comments
 (0)