Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: pad golden file timestamps#12256

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
Emyrk wants to merge2 commits intomainfromstevenmasley/golden-spacing
Closed
Show file tree
Hide file tree
Changes fromall commits
Commits
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
10 changes: 9 additions & 1 deletioncli/clitest/golden.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -122,7 +122,15 @@ ExtractCommandPathsLoop:
// equality check.
funcNormalizeGoldenFile(t*testing.T,byt []byte) []byte {
// Replace any timestamps with a placeholder.
byt=timestampRegex.ReplaceAll(byt, []byte("[timestamp]"))
byt=timestampRegex.ReplaceAllFunc(byt,func(source []byte) []byte {
// Pad the timestamps to maintain the same length. This is mainly for tabled
// output where the padding is important for alignment.
lenSrc:=len(source)
rpl:="timestamp"
required:=lenSrc-2

return []byte("["+fmt.Sprintf("%-*s",required,rpl)+"]")
})

homeDir,err:=os.UserHomeDir()
require.NoError(t,err)
Expand Down
18 changes: 9 additions & 9 deletionscli/testdata/coder_list_--output_json.golden
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
[
{
"id": "[workspace ID]",
"created_at": "[timestamp]",
"updated_at": "[timestamp]",
"created_at": "[timestamp]",
"updated_at": "[timestamp]",
"owner_id": "[first user ID]",
"owner_name": "testuser",
"owner_avatar_url": "",
Expand All@@ -16,8 +16,8 @@
"template_require_active_version": false,
"latest_build": {
"id": "[workspace build ID]",
"created_at": "[timestamp]",
"updated_at": "[timestamp]",
"created_at": "[timestamp]",
"updated_at": "[timestamp]",
"workspace_id": "[workspace ID]",
"workspace_name": "test-workspace",
"workspace_owner_id": "[first user ID]",
Expand All@@ -31,9 +31,9 @@
"initiator_name": "testuser",
"job": {
"id": "[workspace build job ID]",
"created_at": "[timestamp]",
"started_at": "[timestamp]",
"completed_at": "[timestamp]",
"created_at": "[timestamp]",
"started_at": "[timestamp]",
"completed_at": "[timestamp]",
"status": "succeeded",
"worker_id": "[workspace build worker ID]",
"file_id": "[workspace build file ID]",
Expand All@@ -46,7 +46,7 @@
},
"reason": "initiator",
"resources": [],
"deadline": "[timestamp]",
"deadline": "[timestamp]",
"max_deadline": null,
"status": "running",
"daily_cost": 0
Expand All@@ -55,7 +55,7 @@
"name": "test-workspace",
"autostart_schedule": "CRON_TZ=US/Central 30 9 * * 1-5",
"ttl_ms": 28800000,
"last_used_at": "[timestamp]",
"last_used_at": "[timestamp]",
"deleting_at": null,
"dormant_at": null,
"health": {
Expand Down
4 changes: 2 additions & 2 deletionscli/testdata/coder_users_list.golden
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
USERNAME EMAIL CREATED AT STATUS
testuser testuser@coder.com [timestamp] active
testuser2 testuser2@coder.com [timestamp] dormant
testuser testuser@coder.com [timestamp] active
testuser2 testuser2@coder.com [timestamp] dormant
8 changes: 4 additions & 4 deletionscli/testdata/coder_users_list_--output_json.golden
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,8 +5,8 @@
"avatar_url": "",
"name": "",
"email": "testuser@coder.com",
"created_at": "[timestamp]",
"last_seen_at": "[timestamp]",
"created_at": "[timestamp]",
"last_seen_at": "[timestamp]",
"status": "active",
"login_type": "password",
"theme_preference": "",
Expand All@@ -26,8 +26,8 @@
"avatar_url": "",
"name": "",
"email": "testuser2@coder.com",
"created_at": "[timestamp]",
"last_seen_at": "[timestamp]",
"created_at": "[timestamp]",
"last_seen_at": "[timestamp]",
"status": "dormant",
"login_type": "password",
"theme_preference": "",
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp