Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yarn tests #130

Merged
merged 73 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
a7ddb18
add some ignored things
cdmistman Sep 8, 2023
561a9d4
use go 1.20
cdmistman Sep 8, 2023
7d84029
go mod tidy
cdmistman Sep 8, 2023
b6eda31
fix deprecated stdlib APIs from minor version releases cause thats to…
cdmistman Sep 8, 2023
23fb31a
fix deprecated flake output
cdmistman Sep 8, 2023
83f56db
here wigo
cdmistman Sep 22, 2023
08b849f
full nodejs which-language testing
cdmistman Sep 22, 2023
566fe49
more tests
cdmistman Sep 22, 2023
0030043
another test, cleanup
cdmistman Sep 22, 2023
582f469
move some things around, fix some fails
cdmistman Sep 22, 2023
ca8d934
fix testremove logic
cdmistman Sep 22, 2023
26f373c
test guessing
cdmistman Sep 23, 2023
4ec1e89
better test layout
cdmistman Sep 23, 2023
28c0a1f
better search testing
cdmistman Sep 23, 2023
b2517d5
better info testing
cdmistman Sep 23, 2023
4a6f3b7
better add testing
cdmistman Sep 25, 2023
5ee3957
better remove testing
cdmistman Sep 25, 2023
66dfac9
better lock testing
cdmistman Sep 25, 2023
d314465
better install testing
cdmistman Sep 25, 2023
475cebe
better list testing
cdmistman Sep 25, 2023
086adac
better guess testing
cdmistman Sep 25, 2023
eafb537
Merge branch 'main' of github.com:replit/upm into cad/test-suite
cdmistman Oct 2, 2023
9d477be
add package managers to devshell for testing
cdmistman Oct 2, 2023
ec9eb4c
exclude test suite from upm src
cdmistman Oct 2, 2023
4cd86c2
skip test suites that dont have tests
cdmistman Oct 2, 2023
2e6c041
cleanup
cdmistman Oct 3, 2023
9f5f131
add test-suite to ci
cdmistman Oct 3, 2023
69ffccc
add nix to test-suite task
cdmistman Oct 3, 2023
1bdfdb4
share nix store, run make generated
cdmistman Oct 3, 2023
96f78aa
fix dependencies list i think
cdmistman Oct 3, 2023
baebb7e
bleh
cdmistman Oct 3, 2023
74f2e16
dont go run statik just run statik
cdmistman Oct 3, 2023
6f17179
i really hope directly invoking statik in the makefile works
cdmistman Oct 3, 2023
c63816a
remove statik
cdmistman Oct 6, 2023
7110f38
fix vendorhash
cdmistman Oct 6, 2023
efaa523
embed.FS has different expectations to statik.FS
cdmistman Oct 6, 2023
a16644c
lint
cdmistman Oct 6, 2023
38b4396
fix statik->embed paths
cdmistman Oct 6, 2023
7b7a5de
Merge branch 'cad/remove-statik' of github.com:replit/upm into cad/te…
cdmistman Oct 6, 2023
7c6b626
get rid of statik
cdmistman Oct 10, 2023
6ecc2ad
tweak semaphore test task
cdmistman Oct 10, 2023
4492cec
try with self-hosted agent
cdmistman Oct 10, 2023
94ab269
remove some stuff from ci
cdmistman Oct 10, 2023
43961ab
oops
cdmistman Oct 10, 2023
7a563cb
use nix container image
cdmistman Oct 10, 2023
999057c
oops
cdmistman Oct 10, 2023
7457ba1
change image pull secret
cdmistman Oct 10, 2023
c2bb97d
try this instead
cdmistman Oct 10, 2023
3b910ad
only nodejs-yarn tests
cdmistman Oct 3, 2023
22f1a83
fix regex for reading org in package spec
cdmistman Oct 10, 2023
07bdd33
use just self-hosted
cdmistman Oct 12, 2023
dff1d5a
install_nix script
cdmistman Oct 12, 2023
f93384a
forgot to source nix
cdmistman Oct 12, 2023
9cf6129
forgot i dont need the brackets
cdmistman Oct 12, 2023
8e7a54c
set semaphore cache backend
cdmistman Oct 12, 2023
21c7cb6
set cache gcs bucket
cdmistman Oct 12, 2023
12b2e60
nocache
cdmistman Oct 12, 2023
8a8826a
make script more debuggable
cdmistman Oct 12, 2023
c5b656c
source the install_nix script
cdmistman Oct 12, 2023
8c30b5b
publish test results
cdmistman Oct 12, 2023
1991251
go get gotestsum first
cdmistman Oct 12, 2023
16f03a5
try inline nix develop/shell
cdmistman Oct 12, 2023
0b232e1
use makefile for the tests
cdmistman Oct 12, 2023
bf1023e
fix golangci-lint invocation
cdmistman Oct 12, 2023
32e7c30
fix lint
cdmistman Oct 12, 2023
8b69a8d
remove backend tests
cdmistman Oct 12, 2023
4f3e548
Merge branch 'main' into cad/test-suite
cdmistman Oct 12, 2023
a842f33
cleanup
cdmistman Oct 12, 2023
c3c9878
Merge branch 'cad/test-suite' of github.com:replit/upm into cad/yarn-…
cdmistman Oct 12, 2023
e86d5b3
use correct semaphore configs
cdmistman Oct 12, 2023
a5ba1a1
Merge branch 'main' of github.com:replit/upm into cad/yarn-tests
cdmistman Oct 13, 2023
dfdb25c
fix merge
cdmistman Oct 13, 2023
6ec4740
Merge branch 'main' of github.com:replit/upm into cad/yarn-tests
cdmistman Oct 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/backends/nodejs/nodejs.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ var NodejsYarnBackend = api.LanguageBackend{
util.Die("yarn.lock: %s", err)
}
contents := string(contentsB)
r := regexp.MustCompile(`(?m)^"?([^@ \n]+).+:\n version "(.+)"$`)
r := regexp.MustCompile(`(?m)^"?((?:@[^@ \n]+\/)?[^@ \n]+).+:\n version "(.+)"$`)
pkgs := map[api.PkgName]api.PkgVersion{}
for _, match := range r.FindAllStringSubmatch(contents, -1) {
name := api.PkgName(match[1])
Expand Down
2 changes: 2 additions & 0 deletions test-suite/Add_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ func TestAdd(t *testing.T) {

var pkgs []string
switch bt.Backend.Name {
case "nodejs-yarn":
fallthrough
case "bun":
pkgs = []string{"lodash", "react", "@replit/protocol"}

Expand Down
2 changes: 2 additions & 0 deletions test-suite/Guess_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ func TestGuess(t *testing.T) {

tests := make(map[string]map[string][]string)
switch bt.Backend.Name {
case "nodejs-yarn":
fallthrough
case "bun":
for _, ext := range []string{"js", "jsx", "ts", "tsx"} {
_, ok := tests[ext]
Expand Down
2 changes: 2 additions & 0 deletions test-suite/Info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ func TestInfo(t *testing.T) {
bt.Start(t)

switch bt.Backend.Name {
case "nodejs-yarn":
fallthrough
case "bun":
doInfo(bt, "express", "@replit/crosis")

Expand Down
2 changes: 1 addition & 1 deletion test-suite/Install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func TestInstall(t *testing.T) {
for _, bt := range languageBackends {
bt.Start(t)

if bt.Backend.Name != "bun" {
if bt.Backend.Name != "bun" && bt.Backend.Name != "nodejs-yarn" {
t.Run(bt.Backend.Name, func(t *testing.T) {
t.Skip("no test")
})
Expand Down
2 changes: 2 additions & 0 deletions test-suite/List_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ func TestList(t *testing.T) {

var templatesToPackages map[string][]string
switch bt.Backend.Name {
case "nodejs-yarn":
fallthrough
case "bun":
templatesToPackages = map[string][]string{
"no-deps": {},
Expand Down
2 changes: 1 addition & 1 deletion test-suite/Lock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ func TestLock(t *testing.T) {
for _, bt := range languageBackends {
bt.Start(t)

if bt.Backend.Name != "bun" {
if bt.Backend.Name != "bun" && bt.Backend.Name != "nodejs-yarn" {
t.Run(bt.Backend.Name, func(t *testing.T) {
t.Skip("no test")
})
Expand Down
2 changes: 2 additions & 0 deletions test-suite/Remove_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ func TestRemove(t *testing.T) {

var pkgsToRemove map[string][]string
switch bt.Backend.Name {
case "nodejs-yarn":
fallthrough
case "bun":
pkgsToRemove = map[string][]string{
"one-dep": {"express"},
Expand Down
2 changes: 2 additions & 0 deletions test-suite/Search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ func TestSearch(t *testing.T) {
bt.Start(t)

switch bt.Backend.Name {
case "nodejs-yarn":
fallthrough
case "bun":
doSearch(bt, []searchTest{
{"express", "express"},
Expand Down
2 changes: 1 addition & 1 deletion test-suite/WhichLanguage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func TestWhichLanguage(t *testing.T) {
for _, bt := range languageBackends {
bt.Start(t)

if bt.Backend.Name != "bun" {
if bt.Backend.Name != "bun" && bt.Backend.Name != "nodejs-yarn" {
t.Run(bt.Backend.Name, func(t *testing.T) {
t.Skip("no test")
})
Expand Down
19 changes: 19 additions & 0 deletions test-suite/templates/nodejs-yarn/many-deps/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "upm-test-js-project",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"enquirer": "2.4.1",
"eslint": "8.49.0",
"express": "4.18.2",
"svelte": "4.2.1",
"vite": "4.4.9",
"@codemirror/state": "6.2.1"
}
}
Loading